mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Added self promo command, next visit commands for PO and court, added multiple ID support to Shuffle and bumped packages
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using KfChatDotNetBot.Models;
|
||||
using KfChatDotNetBot.Models.DbModels;
|
||||
using KfChatDotNetBot.Settings;
|
||||
using KfChatDotNetWsClient.Models.Events;
|
||||
@@ -41,4 +42,29 @@ public class SetRestreamCommand : ICommand
|
||||
await botInstance.SendChatMessageAsync($"@{message.Author.Username}, updated URL", true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class SelfPromoCommand : ICommand
|
||||
{
|
||||
public List<Regex> Patterns => [
|
||||
new Regex("^selfpromo")
|
||||
];
|
||||
|
||||
public string? HelpText => "Promote your shit";
|
||||
public UserRight RequiredRight => UserRight.Loser;
|
||||
public TimeSpan Timeout => TimeSpan.FromSeconds(10);
|
||||
|
||||
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments,
|
||||
CancellationToken ctx)
|
||||
{
|
||||
var channels = Helpers.GetValue(BuiltIn.Keys.KickChannels).Result.JsonDeserialize<List<KickChannelModel>>();
|
||||
var channel = channels.FirstOrDefault(ch => ch.ForumId == user.KfId);
|
||||
if (channel == null)
|
||||
{
|
||||
await botInstance.SendChatMessageAsync("You have no stream.", true);
|
||||
return;
|
||||
}
|
||||
|
||||
await botInstance.SendChatMessageAsync($"@{user.KfUsername} is a weirdo who streams. Come check out his channel at https://kick.com/{channel.ChannelSlug}", true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user