Extended the command interface so it passes in the user's DB entry. Just avoids having to look it up again if you're doing DB operations involving the user

This commit is contained in:
barelyprofessional
2024-08-10 00:27:06 +08:00
parent a67641a14d
commit 5d1334d2b3
7 changed files with 19 additions and 17 deletions

View File

@@ -15,7 +15,7 @@ public class HowlggStatsCommand : ICommand
public string HelpText => "Get betting statistics in the given window";
public bool HideFromHelp => false;
public UserRight RequiredRight => UserRight.Guest;
public async Task RunCommand(ChatBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
{
var window = Convert.ToInt32(arguments["window"].Value);
var start = DateTimeOffset.UtcNow.AddHours(-window);
@@ -42,7 +42,7 @@ public class HowlggRecentBetCommand : ICommand
public string HelpText => "Get the most recent 3 bets";
public bool HideFromHelp => false;
public UserRight RequiredRight => UserRight.Guest;
public async Task RunCommand(ChatBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
{
var settings = await Helpers.GetMultipleValues([
BuiltIn.Keys.KiwiFarmsGreenColor, BuiltIn.Keys.KiwiFarmsRedColor, BuiltIn.Keys.HowlggDivisionAmount