spaghety
spaghety

Reputation: 59

JDA reaction event listener java

I'm trying to create an event listener for reactions on discord messages for a java discord bot. I haven't found any docs relating to this and my attempts have been futile, the idea is that users who react to the message are subscribed to a mailing list.

public class accept extends ListenerAdapter {
    public void onreactionAdded(MessageReactionAddEvent event) {

        MessageReaction reaction = event.getReaction();
        ReactionEmote emote = reaction.getReactionEmote();
        MessageChannel channel = event.getChannel();
        System.out.println("test");
        channel.sendMessage("Commands:\n !notify - notifies users who have subscribed to mailing list").queue();
    }
}

Upvotes: -1

Views: 7600

Answers (2)

anonymous
anonymous

Reputation: 1

Here's the java doc, it has all the events in it:

ListenerAdapter#onMessageReactionAdd(MessageReactionAddEvent)

you want: onMessageReactionAdd, hope this was useful.

Upvotes: 0

spaghety
spaghety

Reputation: 59

I wrote onreactionAdded instead of onMessageReactionAdd.

Upvotes: 1

Related Questions