mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-04-30 03:22:04 -04:00
Corrected use of Convert.ToInt32 to the SettingsProvider native type conversion
This commit is contained in:
@@ -11,8 +11,8 @@ public class AlmanacShill(ChatBot kfChatBot) : IDisposable
|
||||
|
||||
private async Task AlmanacShillTask()
|
||||
{
|
||||
var interval = await SettingsProvider.GetValueAsync(BuiltIn.Keys.BotAlmanacInterval);
|
||||
using var timer = new PeriodicTimer(TimeSpan.FromSeconds(Convert.ToInt32(interval.Value)));
|
||||
var interval = (await SettingsProvider.GetValueAsync(BuiltIn.Keys.BotAlmanacInterval)).ToType<int>();
|
||||
using var timer = new PeriodicTimer(TimeSpan.FromSeconds(interval));
|
||||
while (await timer.WaitForNextTickAsync(_almanacShillCts.Token))
|
||||
{
|
||||
_logger.Info("Time to shill the almanac in chat");
|
||||
|
||||
Reference in New Issue
Block a user