Skip to content

Commit

Permalink
Fix possible ClassCastException when removing reactions in threads (#…
Browse files Browse the repository at this point in the history
…2069)

fix issue #2068
  • Loading branch information
RoanH authored Apr 12, 2022
1 parent 2b2e29e commit 4b957b6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public RestAction<Void> removeReaction(@Nonnull User user)
throw new PermissionException("Unable to remove Reaction of other user in non-guild channels!");
}

IPermissionContainer permChannel = (IPermissionContainer) this.channel;
IPermissionContainer permChannel = getGuildChannel().getPermissionContainer();
if (!permChannel.getGuild().getSelfMember().hasPermission(permChannel, Permission.MESSAGE_MANAGE))
throw new InsufficientPermissionException(permChannel, Permission.MESSAGE_MANAGE);
}
Expand Down

0 comments on commit 4b957b6

Please sign in to comment.