JDA-Applications / JDA-Utilities

A series of tools and utilities for JDA to assist in bot creation
Apache License 2.0
218 stars 111 forks source link

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

Open YukioKeno opened 5 years ago

YukioKeno commented 5 years ago

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.

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:

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 commented 5 years ago

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

jyao6429 commented 4 years ago

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