This message event did not happen in a guild on MessageReceivedEvent
See original GitHub issueGeneral Troubleshooting
- I have checked for similar issues.
- I have updated to the latest JDA version.
- I have checked the branches or the maintainers’ PRs for upcoming bug fixes.
Bug Report
getting error when I call `event#getGuild()` on MessageReceivedEventExpected Behavior
it should get where the message comes from because the event have `event#getTextChannel()` also so it should be guild info alsoCode Example or Reproduction Steps
N/ACode for JDABuilder or DefaultShardManagerBuilder Used
N/AException or Error
IllegalStateException : This message event did not happen in a guildIssue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Why i get throw error on MessageReceivedEvent when i use ...
I just use event#getGuild() on MessageReceivedEvent, and get the error IllegalStateException: This message event did not happen in a guild ...
Read more >Why i don't have GuildMessageReceivedEvent?
GuildMessageReceiveEvent has been removed and replaced by MessageReceivedEvent in JDA 5+. To only handle guild messages you just check event ...
Read more >net.dv8tion.jda.core.events.message ... - Tabnine
nTo fix this, allow dabBot to " + "`Read Messages` and `Send Messages` in that text channel.\nIf you are not the guild "...
Read more >MessageReceivedEvent (JDA 4.4.0_352 API)
Can be used to detect that a Message is received in either a guild- or private channel. Providing a MessageChannel and Message. Requirements....
Read more >CommandEvent
CommandEvent(net.dv8tion.jda.core.events.message.MessageReceivedEvent ... Tests whether or not the User who triggered this event is an owner of the bot.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
bro answer…
it’s still… i use
5.0.0-alpha.2
version, also both ofgetGuildChannel / getGuild
throws this error on the event please don’t forget I’m usingMessageReceivedEvent