Make sure that you've checked all the items below.
[X] Bot has the following permissions:
MESSAGE_MANAGE
MESSAGE_ADD_REACTION
MESSAGE_EXT_EMOJI
MESSAGE_READ/WRITE
VIEW_CHANNEL
[X] If using JDABuilder.createLight(), you added the following gateway intents:
GUILD_MESSAGES
GUILD_MESSAGE_REACTIONS
[X] PaginationUtils is up-to-date.
[X] You have activated the library as descripted in the README.
Library info
What libraries versions are you using.
JDA version 4.2.0_225
PaginationUtils version 2.0.0
Describe the bug
When executing Pages.paginate on a message that was sent in a DM with a user, the library attempts to set the timeout variable by calling msg.clearReactions(). This throws an exception because the bot cannot clear reactions from a message in a DM:
java.lang.IllegalStateException: Cannot clear reactions from a message in a Group or PrivateChannel.
at net.dv8tion.jda.internal.entities.ReceivedMessage.clearReactions(ReceivedMessage.java:175) ~[JDA-4.2.0_225.jar:4.2.0_225]
at com.github.ygimenez.method.Pages$1.<init>(Pages.java:138) ~[Pagination-Utils-2.0.0.jar:na]
at com.github.ygimenez.method.Pages.paginate(Pages.java:131) ~[Pagination-Utils-2.0.0.jar:na]
After the exception is thrown, the reactions will not change pages anymore.
To Reproduce
Steps to reproduce the behavior:
Open a private channel with a user, or execute a command in a DM with the bot that will cause a paged message/embed to be created.
Call Pages.paginate on the message that was sent from the bot user in the DM channel
An exception should be thrown and the pages will not change upon reacting
Expected behavior
There shouldn't be any exceptions thrown and the buttons should respond. The timeout variable should probably be changed to call removeReaction on all of the individual reactions added by the bot if the message is in a private channel or group. There's probably some more stuff that needs to be added in order to support private channels/groups, like detecting both reaction add and remove in order to change pages.
Screenshots
N/A
Additional context
It seems like this problem was fixed in #5 but with the release of 2.0.0 the fix may have gotten replaced with code which doesn't support private channels/groups.
Checklist
Make sure that you've checked all the items below.
JDABuilder.createLight()
, you added the following gateway intents:Library info
What libraries versions are you using.
Describe the bug
When executing
Pages.paginate
on a message that was sent in a DM with a user, the library attempts to set thetimeout
variable by callingmsg.clearReactions()
. This throws an exception because the bot cannot clear reactions from a message in a DM:After the exception is thrown, the reactions will not change pages anymore.
To Reproduce
Steps to reproduce the behavior:
Pages.paginate
on the message that was sent from the bot user in the DM channelExpected behavior
There shouldn't be any exceptions thrown and the buttons should respond. The
timeout
variable should probably be changed to callremoveReaction
on all of the individual reactions added by the bot if the message is in a private channel or group. There's probably some more stuff that needs to be added in order to support private channels/groups, like detecting both reaction add and remove in order to change pages.Screenshots
N/A
Additional context
It seems like this problem was fixed in #5 but with the release of 2.0.0 the fix may have gotten replaced with code which doesn't support private channels/groups.