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