Skip to content

Commit a3acfd7

Browse files
committed
minor cleaning
1 parent 99ab5c2 commit a3acfd7

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CommandHandlers/UserCommands.cs

+4
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ private static string ReplaceIfMultiple(string text, char c, char replacement)
146146
/// <returns>The escaped result.</returns>
147147
public static string EscapeUserInput(string text)
148148
{
149+
if (text is null)
150+
{
151+
return "(null)";
152+
}
149153
text = text.Replace("discord.gg", "discord\x00B7gg");
150154
if (NeedsEscapeMatcher.ContainsAnyMatch(text))
151155
{

DiscordBot.cs

+4
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ public void InitAndRun(string[] args)
319319
};
320320
Client.SlashCommandExecuted += (command) =>
321321
{
322+
if (BotMonitor.ShouldStopAllLogic())
323+
{
324+
return Task.CompletedTask;
325+
}
322326
Console.WriteLine($"Found slash command '{command.CommandName}' from user id {command.User.Id} in channel id {command.Channel.Id}");
323327
if (!ClientConfig.AllowSlashCommandsInDM && command.Channel is not IGuildChannel)
324328
{

0 commit comments

Comments
 (0)