不协调的java bot没有响应

gojuced7  于 2021-06-26  发布在  Java
关注(0)|答案(0)|浏览(223)

所以我的discord机器人不会响应我的消息:/这是我的代码。也许你能帮我。

public static JDA jda;
    public static String prefix = "+";

    // Main method
    public static void main(String[] args)  throws LoginException{

        jda = JDABuilder.createDefault(REDACTED).build();
        jda.getPresence().setStatus(OnlineStatus.DO_NOT_DISTURB);
        jda.getPresence().setActivity(Activity.watching("Im watching you"));

        jda.addEventListener(new Commands());

    }
}

命令侦听器:

public void onGuildMessageRecived(GuildMessageReceivedEvent event) {
        String[] args = event.getMessage().getContentRaw().split(" ");

        if(args[0].equalsIgnoreCase(Main.prefix + "info")) {

            event.getChannel().sendTyping().queue();
            event.getChannel().sendMessage("Started on 09.01.2021").queue();

        }
    }
}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题