Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent;
import net.dv8tion.jda.api.exceptions.ErrorResponseException;
import net.dv8tion.jda.api.requests.ErrorResponse;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -56,7 +58,17 @@ private static void reactWith(@NotNull String emoteName, @NotNull String fallbac
"Unable to vote on a suggestion with the configured emote ('{}'), using fallback instead.",
emoteName);
return message.addReaction(fallbackUnicodeEmote);
}).queue();
}).queue(ignored -> {
}, exception -> {
if (exception instanceof ErrorResponseException responseException
&& responseException.getErrorResponse() == ErrorResponse.REACTION_BLOCKED) {
// User blocked the bot, hence the bot can not add reactions to their messages.
// Nothing we can do here.
return;
}

logger.error("Attempted to react to a suggestion, but failed", exception);
});
}

private static @NotNull Optional<Emote> getEmoteByName(@NotNull String name,
Expand Down