You are facing an issue described in a discord developer support article:
WHY IS MY BOT NO LONGER WORKING SUDDENLY?
When the new gateway update was deployed, bots which weren't adequately prepared to specify gateway intents could have experienced a variety of issues. Common symptoms include:
- The bot not responding anymore, despite being online
- The bot cache being empty (only seeing a few users across all guilds)
- A library on ready event not firing or timing out (happening mostly on discord.py and discord.js bots but other libraries might exhibit the same behavior)
If you are affected by this, this is because of 2 gateway changes:
- You no longer have access to disabled privileged intents if you are not specifying intents
- You can no longer request member info for multiple guilds at the same time
HOW DO I GET BACK UP AND RUNNING?
UPDATING YOUR LIBRARY
First, you must make sure you're using a library version that can handle intents, and by extension no longer requests information on multiple guilds at once.
For discord.py, this means you need to update to v1.5 or higher.
For discord.js, this means you need to update to v12 or higher.
If you're unsure how to upgrade your bot to a new library release or are unclear regarding the intent compatibility of an alternative library, please see the library links provided in our Developer Community Resources.
SPECIFYING GATEWAY INTENTS
Please note that a variety of our gateway intents are not privileged, meaning they do not require specific switches to be flipped or whitelisted access to be requested. You can review the entirety of our available intents here.
Specifying which intents you'd like to receive varies based on your chosen library. Documentation on how to specify gateway intents in discord.js is available here. Documentation for specifying gateway intents in discord.py is available here.
So, you need to update JDA at first. I would recommend you to use the latest version for this. You can see the latest version code here:
After that, you should change the use of the constructor of JDABuilder as defined in the README of JDA like this:
JDABuilder builder=JDABuilder.createDefault("YOUR_TOKEN_HERE");
If you need privileged gateway intents, you also need to enable those both on the developer page and in your application.