Relocated the Discord command and made it a toggle

This commit is contained in:
barelyprofessional
2025-10-01 11:47:04 -05:00
parent d3e62476d2
commit 2a0f74ab18
2 changed files with 18 additions and 17 deletions

View File

@@ -536,4 +536,22 @@ public class ToggleForcedGambaMessagesCommand : ICommand
botInstance.BotServices.TemporarilyForceGambaMessages = !botInstance.BotServices.TemporarilyForceGambaMessages;
await botInstance.SendChatMessageAsync($"TemporarilyForceGambaMessages is now {botInstance.BotServices.TemporarilyForceGambaMessages}", true);
}
}
public class ToggleDiscordRelayingCommand : ICommand
{
public List<Regex> Patterns => [
new Regex("^tempenable discord$", RegexOptions.IgnoreCase),
new Regex("^admin toggle discord", RegexOptions.IgnoreCase)
];
public string? HelpText => null;
public UserRight RequiredRight => UserRight.Guest;
public TimeSpan Timeout => TimeSpan.FromSeconds(10);
public RateLimitOptionsModel? RateLimitOptions => null;
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
{
botInstance.BotServices.TemporarilyBypassGambaSeshForDiscord = !botInstance.BotServices.TemporarilyBypassGambaSeshForDiscord;
await botInstance.SendChatMessageAsync($"TemporarilyBypassGambaSeshForDiscord is now {botInstance.BotServices.TemporarilyBypassGambaSeshForDiscord}", true);
}
}

View File

@@ -6,23 +6,6 @@ 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 RateLimitOptionsModel? RateLimitOptions => null;
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx)
{
botInstance.BotServices.TemporarilyBypassGambaSeshForDiscord = true;
await botInstance.SendChatMessageAsync("Enjoy Discord messages, stalker child", true);
}
}
public class TempSuppressGambaMessages : ICommand
{
public List<Regex> Patterns => [