Corrected use of Convert.ToInt32 to the SettingsProvider native type conversion

This commit is contained in:
barelyprofessional
2025-07-20 01:28:05 -05:00
parent c134a6808d
commit 56616d713f

View File

@@ -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");