Skip to content

Commit

Permalink
Fix Discord bot crash when some bots send embed only message (no text…
Browse files Browse the repository at this point in the history
… content) with relay bot message turned on
  • Loading branch information
DenisD3D authored Dec 31, 2023
1 parent bcdf0a5 commit 5f91d27
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public static void onMessageCreate(MessageCreateEvent event) {

if (member.isBot() && !Mc2Discord.INSTANCE.config.misc.relay_bot_messages) return; // Bot messages

if (event.getMessage().getContent().isEmpty()) return; // no text content to process

if (event.getMessage().getContent().startsWith(Mc2Discord.INSTANCE.config.commands.prefix) && Mc2Discord.INSTANCE.config.channels.channels.stream().filter(channel -> channel.subscriptions.contains("command")).anyMatch(channel -> channel.channel_id.equals(event.getMessage().getChannelId()))) { // Commands
processCommand(event, member);
} else if (Mc2Discord.INSTANCE.config.channels.channels.stream().filter(channel -> channel.subscriptions.contains("chat") || channel.subscriptions.contains("discord")).anyMatch(channel -> channel.channel_id.equals(event.getMessage().getChannelId()))) { // Chat or Discord
Expand Down

0 comments on commit 5f91d27

Please sign in to comment.