我正在尝试为java discord bot的discord消息上的反应创建一个事件监听器。我没有找到任何与此相关的文档,我的尝试都是徒劳的,其想法是对邮件做出反应的用户订阅了邮件列表。
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();
}
}
我写了onreactionAdded而不是onMessageReactionAdd。
这是java文档,它包含所有事件:
你想要:onMessageReactionAdd
,希望这很有用。