Closed Alf-Melmac closed 9 months ago
If you use the interaction hook, you can send messages without permissions. The right way to handle interactions is to send all your messages through that hook instead.
Thanks for the hint and the fix :). This isn't my production setup, but it is the easiest way to reproduce the problem. I'll keep that in mind.
General Troubleshooting
Version of JDA
5.0.0-beta.19
Expected Behaviour
JDA should check if the bot is member of a private thread.
I'm consuming a slash command interaction from a private thread that the bot is not a member of. Before sending a (non ephemeral) message i check the permission with
event.getChannel().canTalk()
. TheThreadChannelImpl
only checks in the parent channel if the bot member has the permission to view the channel and can send messages but doesn't check if the member is allowed to send messages in this specific thread.Code Example for Reproduction Steps
Discord setup: Create a private thread in a public channel.
Code for JDABuilder or DefaultShardManagerBuilder used
Exception or Error
No response