Merge branch 'hotfix/ignore_nonrelay' into main

This commit is contained in:
Oliver Booth 2023-08-26 16:40:44 +01:00
commit 0deb14e137
Signed by: oliverbooth
GPG Key ID: B89D139977693FED
1 changed files with 3 additions and 0 deletions

View File

@ -102,6 +102,9 @@ internal sealed partial class DiscordMessageService : BackgroundService, IDiscor
if (author.IsBot && !_configurationService.BotConfiguration.RelayBotMessages) if (author.IsBot && !_configurationService.BotConfiguration.RelayBotMessages)
return Task.CompletedTask; return Task.CompletedTask;
if (message.Channel.Id != _configurationService.DiscordConfiguration.ChannelId)
return Task.CompletedTask;
string displayName = author.GlobalName ?? author.Username; string displayName = author.GlobalName ?? author.Username;
string unescaped = UnescapeRegex.Replace(message.Content, "$1"); string unescaped = UnescapeRegex.Replace(message.Content, "$1");
string content = EscapeRegex.Replace(unescaped, "\\$1"); string content = EscapeRegex.Replace(unescaped, "\\$1");