From 56616d713fcdcaef482c9ebbaad3230396ec44ac Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Sun, 20 Jul 2025 01:28:05 -0500 Subject: [PATCH] Corrected use of Convert.ToInt32 to the SettingsProvider native type conversion --- KfChatDotNetBot/Services/AlmanacShill.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/KfChatDotNetBot/Services/AlmanacShill.cs b/KfChatDotNetBot/Services/AlmanacShill.cs index 55c6dab..888bbe1 100644 --- a/KfChatDotNetBot/Services/AlmanacShill.cs +++ b/KfChatDotNetBot/Services/AlmanacShill.cs @@ -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(); + using var timer = new PeriodicTimer(TimeSpan.FromSeconds(interval)); while (await timer.WaitForNextTickAsync(_almanacShillCts.Token)) { _logger.Info("Time to shill the almanac in chat");