Fix bot-command-relay option not ignoring itself (#4453)

This commit is contained in:
Josh Roy 2021-08-12 04:37:19 -07:00 committed by GitHub
parent 35b1a284f3
commit 1179caab88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,7 @@ public class DiscordCommandDispatcher extends ListenerAdapter {
@Override
public void onGuildMessageReceived(@NotNull GuildMessageReceivedEvent event) {
if (jda.getConsoleWebhook() != null && event.getChannel().getId().equals(channelId)) {
if ((event.isWebhookMessage() || event.getAuthor().isBot()) && (!jda.getSettings().isConsoleBotCommandRelay() || DiscordUtil.ACTIVE_WEBHOOKS.contains(event.getAuthor().getId()))) {
if ((event.isWebhookMessage() || event.getAuthor().isBot()) && (!jda.getSettings().isConsoleBotCommandRelay() || DiscordUtil.ACTIVE_WEBHOOKS.contains(event.getAuthor().getId()) || event.getAuthor().getId().equals(event.getGuild().getSelfMember().getId()))) {
return;
}