From b65659d6371e5e0b18ad76eb8d557de08cdfbddf Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Mon, 17 Feb 2025 01:07:50 +0800 Subject: [PATCH] Added a command to provide restream value plain so it can be updated easier --- KfChatDotNetBot/Commands/RestreamCommands.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/KfChatDotNetBot/Commands/RestreamCommands.cs b/KfChatDotNetBot/Commands/RestreamCommands.cs index 579ea6b..3bf6cb8 100644 --- a/KfChatDotNetBot/Commands/RestreamCommands.cs +++ b/KfChatDotNetBot/Commands/RestreamCommands.cs @@ -22,7 +22,6 @@ public class GetRestreamCommand : ICommand var url = await Helpers.GetValue(BuiltIn.Keys.RestreamUrl); await botInstance.SendChatMessageAsync($"@{message.Author.Username}, restream URL: {url.Value}", true); } - } public class SetRestreamCommand : ICommand @@ -67,4 +66,22 @@ public class SelfPromoCommand : ICommand await botInstance.SendChatMessageAsync($"@{user.KfUsername} is a weirdo who streams. Come check out his channel at https://kick.com/{channel.ChannelSlug}", true); } +} + +public class GetRestreamPlainCommand : ICommand +{ + public List Patterns => [ + new Regex("^restream plain$") + ]; + + public string? HelpText => "Grab restream URL with plain prefixed"; + 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) + { + var url = await Helpers.GetValue(BuiltIn.Keys.RestreamUrl); + await botInstance.SendChatMessageAsync($"@{message.Author.Username}, restream URL: [plain]{url.Value}", true); + } } \ No newline at end of file