mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Added command for posting Zalgo text for crackhead screaming moments
This commit is contained in:
@@ -2,6 +2,7 @@ using System.Text.RegularExpressions;
|
||||
using KfChatDotNetBot.Models.DbModels;
|
||||
using KfChatDotNetBot.Settings;
|
||||
using KfChatDotNetWsClient.Models.Events;
|
||||
using Zalgo;
|
||||
|
||||
namespace KfChatDotNetBot.Commands;
|
||||
|
||||
@@ -71,4 +72,22 @@ public class GmKasinoCommand : ICommand
|
||||
var image = images[random.Next(images.Count)];
|
||||
botInstance.SendChatMessage($"[img]{image}[/img]", true);
|
||||
}
|
||||
}
|
||||
|
||||
public class CrackedCommand : ICommand
|
||||
{
|
||||
public List<Regex> Patterns => [new Regex("^cracked (?<msg>.+)")];
|
||||
public string? HelpText => "Crackhead Zalgo text";
|
||||
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 msg = arguments["msg"].Value.TrimStart('/');
|
||||
var settings = await Helpers.GetMultipleValues([
|
||||
BuiltIn.Keys.CrackedZalgoFuckUpMode, BuiltIn.Keys.CrackedZalgoFuckUpPosition
|
||||
]);
|
||||
var zalgo = new ZalgoString(msg, (FuckUpMode)settings[BuiltIn.Keys.CrackedZalgoFuckUpMode].ToType<int>(),
|
||||
(FuckUpPosition)settings[BuiltIn.Keys.CrackedZalgoFuckUpPosition].ToType<int>());
|
||||
botInstance.SendChatMessage(zalgo.ToString(), true);
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@
|
||||
<PackageReference Include="NLog" Version="5.3.3" />
|
||||
<PackageReference Include="System.Runtime.Caching" Version="8.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="8.0.4" />
|
||||
<PackageReference Include="Zalgo" Version="0.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -479,6 +479,23 @@ public static class BuiltIn
|
||||
Default = "10",
|
||||
IsSecret = false,
|
||||
CacheDuration = TimeSpan.FromHours(1)
|
||||
new BuiltInSettingsModel
|
||||
{
|
||||
Key = Keys.CrackedZalgoFuckUpMode,
|
||||
Regex = @"\d+",
|
||||
Description = "FuckUpMode. 0 = Min, 1 = Normal, 2 = Max",
|
||||
Default = "1",
|
||||
IsSecret = false,
|
||||
CacheDuration = TimeSpan.FromHours(1)
|
||||
},
|
||||
new BuiltInSettingsModel
|
||||
{
|
||||
Key = Keys.CrackedZalgoFuckUpPosition,
|
||||
Regex = @"\d+",
|
||||
Description = "FuckUpPosition: 1 = Up, 2 = Middle, 3 = UpAndMiddle, 4 = Bot (Bottom), 5 = UpAndBot, 6 = MiddleAndBot, 7 = All",
|
||||
Default = "2",
|
||||
IsSecret = false,
|
||||
CacheDuration = TimeSpan.FromHours(1)
|
||||
}
|
||||
];
|
||||
|
||||
@@ -524,5 +541,7 @@ public static class BuiltIn
|
||||
public static string TwitchShillRestreamOnCommercial = "Twitch.ShillRestreamOnCommercial";
|
||||
public static string KiwiFarmsInactivityTimeout = "KiwiFarms.InactivityTimeout";
|
||||
public static string KiwiFarmsPingInterval = "KiwiFarms.PingInterval";
|
||||
public static string CrackedZalgoFuckUpMode = "Cracked.ZalgoFuckUpMode";
|
||||
public static string CrackedZalgoFuckUpPosition = "Cracked.ZalgoFuckUpPosition";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user