JDA is not registering EventListeners

Created on 28 Oct 2020  路  2Comments  路  Source: DV8FromTheWorld/JDA

General Troubleshooting

  • [ ] I have checked for similar issues.
  • [ ] I have updated to the latest JDA version
  • [ ] I have checked the [wiki] and especially the [FAQ] section for similar questions.

Question

So, JDA is in maintenance right know? Neither me or my friend's Discord Bot is registering EventListeners. All I can do is make the bot online.

Example Code

  public void setupBot(){
        try {
            jda = new JDABuilder(AccountType.BOT).setToken("NzY0NTEwODE0ODk5Nzk4MDM2.X4HULg.Dp7BFgQMBJh4wOANm4mpdUaqTvo").build();
            jda.addEventListener(new Authorize());
            jda.addEventListener(new Tickets());
            jda.addEventListener(new Verify());
            activityRunnable();
        } catch (LoginException e) {
            e.printStackTrace();
        }
    }

    public void disable(){
        jda.shutdownNow();
    }

    private void activityRunnable(){
        new Timer().schedule(
                new TimerTask() {
                    @Override
                    public void run() {
                        if (number != Bukkit.getOnlinePlayers().size()) {
                            number = Bukkit.getOnlinePlayers().size();
                            jda.getPresence().setActivity(Activity.playing("jogar.rankupfacturer.tk - " + number + " online"));
                        }
                    }
                }, 1000, 1000*10

        );
    }

Most helpful comment

nice bot token

All 2 comments

nice bot token

You're using a deprecated feature. The new JDABuilder(...) constructor has been deprecated for months and should be replaced with the static factory functions. Such as JDABuilder.createDefault(token).

Read up on intents and caching:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AutismSpeaks picture AutismSpeaks  路  4Comments

istamendil picture istamendil  路  3Comments

xeu100 picture xeu100  路  5Comments

YukioKeno picture YukioKeno  路  6Comments

andrei1058 picture andrei1058  路  6Comments