#JDA (Discord Bot)

35 messages · Page 1 of 1 (latest)

gusty panther
#

I am facing an issue where a method is valid and not giving any error but it is not working.

hasty kayakBOT
#

This post has been reserved for your question.

Hey @gusty panther! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

gusty panther
#

yesterday, i was facing a problem of some classes not getting imported, when I read the docs, they change the class name.
Now the problem is, I made the bot, and it is onMessageReceived method is working, but the event.getMessage() is not working.|
Also, event.getAuthor() is working. idk whats going on?

restive patrol
#

sounds like you don't have the Message Content intent

gusty panther
#

Whenever i send a message, the method does work. but the getMessage() does not work

restive patrol
#

it's working as intended

gusty panther
gusty panther
restive patrol
#

Message Content is considered private data so discord restricts it, you have to manually enable it, and for large bots (>=100 guilds), the bot has to be verified

gusty panther
#

so do you think, that the tutorial i watched had this done already?

restive patrol
#

enable it in the discord dev portal, and you'll probably also have to include it in your JDA setup, don't remember how jda works

gusty panther
#

or they changed it ?

restive patrol
gusty panther
#

becoz many things in JDA have been changed

restive patrol
#

this is why video tutorials are inferior

gusty panther
#

so what do I do now?

restive patrol
#

probably ditch it for something up-to-date

gusty panther
#

any fix or solution?

restive patrol
#

i literally just gave you the fix

gusty panther
#

yeah ik, like what should I do to make it work

restive patrol
#

you have to manually enable it

#

and then i told you immediately after how to manually enable it

gusty panther
#

so it needs to be verified, which is possible or not? coz idk much about this stuff. I just wanted to make something

restive patrol
#

it doesn't need to be verified

#

and for large bots (>=100 guilds), the bot has to be verified

gusty panther
#

Yo, i got it what you were saying, and my bot is ofc under 100 servers, but I cant find a way to enable the message content in the discord application portal

restive patrol
#

go to your app, in the sidebar go to the "Bot" section, scroll down to privileged intents

gusty panther
#

yeah got it.

#

@restive patrol it worked

#

thanks a lot

hasty kayakBOT
# gusty panther thanks a lot

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.

gusty panther
#

also i did enabled the gatewayintent in my code