JDA icon indicating copy to clipboard operation
JDA copied to clipboard

Cannot add reactions to messages in forum threads

Open ApoY2k opened this issue 3 years ago • 2 comments
trafficstars

General Troubleshooting

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

Expected Behaviour

When adding reactions to forum thread messages, JDA should be able to add reactions to messages in form threads

Code Example for Reproduction Steps

suspend fun executeFavCommand(storage: Storage, event: SlashCommandInteractionEvent) {
    val interaction = event.reply("Fetching candidates...").await()
    val original = interaction.retrieveOriginal().await()
    original.addReaction("👍").await()
    original.addReaction("👎").await()
}

Code for JDABuilder or DefaultShardManagerBuilder used

val jda = JDABuilder.createDefault(env.authToken).build()

Exception or Error

java.lang.NullPointerException: Cannot invoke "net.dv8tion.jda.api.entities.GuildChannel.getPermissionContainer()" because "channel" is null
at net.dv8tion.jda.internal.entities.mixin.channel.middleman.GuildChannelMixin.hasPermission(GuildChannelMixin.java:48)
at net.dv8tion.jda.internal.entities.mixin.channel.middleman.GuildChannelMixin.checkPermission(GuildChannelMixin.java:51)
at net.dv8tion.jda.internal.entities.mixin.channel.middleman.GuildMessageChannelMixin.checkCanAccessChannel(GuildMessageChannelMixin.java:107)
at net.dv8tion.jda.internal.entities.mixin.channel.middleman.MessageChannelMixin.addReactionBy

ApoY2k avatar Aug 10 '22 18:08 ApoY2k

Forums are implemented by #2184, can you try with that instead?

MinnDevelopment avatar Aug 10 '22 18:08 MinnDevelopment

@MinnDevelopment Will give it a try, thanks for the hint

ApoY2k avatar Aug 10 '22 18:08 ApoY2k

Fixed in 5.0.0-alpha.20

MinnDevelopment avatar Sep 21 '22 17:09 MinnDevelopment