JDA反应事件监听器java

问题描述 投票:-1回答:2

我正在尝试为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();
    }
}
java discord discord-jda
2个回答
1
投票

我写了onreactionAdded而不是onMessageReactionAdd。


© www.soinside.com 2019 - 2024. All rights reserved.