mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Update to the Settings interface.
- Methods are now suffixed async - Extension methods moved to the actual class and class renamed from SettingValue to Setting - "Helpers" renamed to "SettingsProvider" - Removed the ghetto CSV list method. Only setting using it was Pusher Channels which was orphaned by the new Kick channel feature. The call to ToList in the Chips.gg integration was incorrect and just proves lists should be consistently based around JSON objects instead of randomly string splitting
This commit is contained in:
@@ -19,7 +19,7 @@ public class HowlggStatsCommand : ICommand
|
||||
{
|
||||
var window = Convert.ToInt32(arguments["window"].Value);
|
||||
var start = DateTimeOffset.UtcNow.AddHours(-window);
|
||||
var division = (await Helpers.GetValue(BuiltIn.Keys.HowlggDivisionAmount)).ToType<float>();
|
||||
var division = (await SettingsProvider.GetValueAsync(BuiltIn.Keys.HowlggDivisionAmount)).ToType<float>();
|
||||
await using var db = new ApplicationDbContext();
|
||||
// EF SQLite doesn't support filtering on dates :(
|
||||
var bets = (await db.HowlggBets.ToListAsync(ctx)).Where(b => b.Date.UtcDateTime > start).ToList();
|
||||
@@ -44,7 +44,7 @@ public class HowlggRecentBetCommand : ICommand
|
||||
public TimeSpan Timeout => TimeSpan.FromSeconds(10);
|
||||
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
|
||||
{
|
||||
var settings = await Helpers.GetMultipleValues([
|
||||
var settings = await SettingsProvider.GetMultipleValuesAsync([
|
||||
BuiltIn.Keys.KiwiFarmsGreenColor, BuiltIn.Keys.KiwiFarmsRedColor, BuiltIn.Keys.HowlggDivisionAmount
|
||||
]);
|
||||
var division = settings[BuiltIn.Keys.HowlggDivisionAmount].ToType<float>();
|
||||
|
||||
Reference in New Issue
Block a user