JDA-Utilities icon indicating copy to clipboard operation
JDA-Utilities copied to clipboard

IllegalStateException: This message event did not happen in a text channel

Open YukioKeno opened this issue 4 years ago • 2 comments

Issue

Issue Checklist

Please follow the following steps before opening this issue.
Issues that do not complete the checklist may be closed without any help.

  • [X] I have checked for similar issues on the [issue tracker][issues].
  • [X] I have updated to the [latest version][download] of JDA-Utilities.
  • [X] I have checked the branches or the maintainers' PRs for upcoming features/bug fixes.

The issue tracker is reserved for issues, errors, and feature requests related to JDA-Utilities, and not questions and other requests for help.

  • For examples, check out the [examples module][examples-module] or the list of [JDA-Utilities projects][jda-u-projects].
  • For questions join the [official JDA discord server][guild] and ask them in our #jda-utilities channel.
  • For general programming questions, visit [StackOverflow][stack overflow].

Issue Information

Check all that apply:

  • [X] This is a bug report about an error, issue, or bug in JDA-Utilities.
    • [x] I have been able to consistently reproduce this bug.
  • [ ] This is a feature request for the JDA-Utilities library.

This issue tracker does not assist or handle issues with the JDA library.
For JDA related issues, visit the [JDA issue tracker][jda-issues] and open an issue there.

Description

When I use the ButtonBuilder in a private message and the user react to answer it the buttonMenu use the function event.getGuild (ButtonMenu.java:135). This function call is try getting the guild from a TextChannel (GenericMessageEvent.java:126) and not from a private channel. This ends in a IllegalStateException: This message event did not happen in a text channel

YukioKeno avatar Jul 21 '19 09:07 YukioKeno

I think it's related to this from the new JDA version 4 https://github.com/DV8FromTheWorld/JDA/wiki/0%29-Migrating-to-V4#messages

YukioKeno avatar Jul 21 '19 09:07 YukioKeno

I am getting the same error when trying to use the AboutCommand in a DM

jyao6429 avatar Sep 25 '20 01:09 jyao6429