Skip to content

Commit

Permalink
Fix bot channel check
Browse files Browse the repository at this point in the history
  • Loading branch information
hhvrc committed Sep 13, 2024
1 parent 7b367f7 commit 6d7d1df
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions DiscordBot/MessageHandler/MessageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ public MessageHandler(IServiceProvider serviceProvider)
_serviceProvider = serviceProvider;
}

[GeneratedRegex("\bbot\b", RegexOptions.IgnoreCase | RegexOptions.Singleline)]
private partial Regex BotChannelMatchingRegex();

private static async Task<bool> CheckUserProfanityShockingOptIn(AsyncServiceScope scope, ulong userDiscordId)
{
var db = scope.ServiceProvider.GetRequiredService<OpenShockDiscordContext>();
Expand All @@ -46,7 +43,7 @@ public async Task HandleMessageAsync(SocketMessage message)
float intensityPercent = weight * 100f;

// If the channel is a bot channel, respond with debug message
if (BotChannelMatchingRegex().IsMatch(message.Channel.Name))
if (message.Channel.Id == 1114123393567047730)
{
await message.Channel.SendMessageAsync($"Profanity detected! {count} bad {(count > 1 ? "words" : "word")}, shocking at {intensityPercent}%");
}
Expand Down

0 comments on commit 6d7d1df

Please sign in to comment.