ignore own messages

master
BodgeMaster 2022-02-22 20:10:44 +01:00
parent 4222046c20
commit 9590e717bb
1 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,6 @@ package linux.general.hackyquizbot;
import java.util.concurrent.ExecutionException;
import org.javacord.api.entity.emoji.Emoji;
import org.javacord.api.entity.message.Message;
import org.javacord.api.entity.user.User;
@ -26,9 +25,10 @@ public class QuizHandler {
+ "Select the :white_check_mark: reaction to continue.").get();
message.addReaction(EmojiParser.parseToUnicode(":white_check_mark:"));
message.addReactionAddListener(event -> {
System.err.println("Received a reaction");
if (event.getReaction().get().getEmoji().equalsEmoji(EmojiParser.parseToUnicode(":white_check_mark:"))) {
if (!event.getUser().get().isYourself() && event.getReaction().get().getEmoji().equalsEmoji(EmojiParser.parseToUnicode(":white_check_mark:"))) {
event.getMessage().get().getChannel().sendMessage("test");
//TODO: trigger question dispatch
//TODO: remove ReactionAddListener
}
});
} catch (InterruptedException | ExecutionException e) {