Added the ability to selectively enable Discord integration for when GambaSesh wigs out and manually control the bet feed given there's no obvious signal when Bossman is live (I might tie in the stage notifications as an alternative tho)

This commit is contained in:
barelyprofessional
2024-08-23 12:32:51 +08:00
parent a717224ee4
commit f81a2f5a42
2 changed files with 85 additions and 4 deletions

View File

@@ -0,0 +1,53 @@
using System.Text.RegularExpressions;
using KfChatDotNetBot.Models.DbModels;
using KfChatDotNetWsClient.Models.Events;
namespace KfChatDotNetBot.Commands;
public class TempEnableDiscordRelayingCommand : ICommand
{
public List<Regex> Patterns => [
new Regex("^tempenable discord$")
];
public string? HelpText => null;
public UserRight RequiredRight => UserRight.Guest;
public TimeSpan Timeout => TimeSpan.FromSeconds(10);
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
{
botInstance.TemporarilyBypassGambaSeshForDiscord = true;
botInstance.SendChatMessage("Enjoy Discord messages, stalker child", true);
}
}
public class TempSuppressGambaMessages : ICommand
{
public List<Regex> Patterns => [
new Regex("^nogamba$")
];
public string? HelpText => null;
public UserRight RequiredRight => UserRight.Guest;
public TimeSpan Timeout => TimeSpan.FromSeconds(10);
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
{
botInstance.TemporarilySuppressGambaMessages = true;
botInstance.SendChatMessage("No more gamba notifs", true);
}
}
public class EnableGambaMessages : ICommand
{
public List<Regex> Patterns => [
new Regex("^yesgamba")
];
public string? HelpText => null;
public UserRight RequiredRight => UserRight.Guest;
public TimeSpan Timeout => TimeSpan.FromSeconds(10);
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
{
botInstance.TemporarilySuppressGambaMessages = false;
botInstance.SendChatMessage("Gamba notifs back on the menu", true);
}
}