|
5 | 5 | import net.dv8tion.jda.api.EmbedBuilder; |
6 | 6 | import net.dv8tion.jda.api.entities.Message; |
7 | 7 | import net.dv8tion.jda.api.entities.UserSnowflake; |
| 8 | +import net.dv8tion.jda.api.entities.channel.Channel; |
8 | 9 | import net.dv8tion.jda.api.entities.channel.ChannelType; |
9 | 10 | import net.dv8tion.jda.api.entities.channel.concrete.ForumChannel; |
10 | 11 | import net.dv8tion.jda.api.entities.channel.concrete.ThreadChannel; |
11 | | -import net.dv8tion.jda.api.entities.channel.unions.ChannelUnion; |
12 | | -import net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion; |
13 | | -import net.dv8tion.jda.api.entities.emoji.Emoji; |
14 | 12 | import net.dv8tion.jda.api.events.channel.ChannelCreateEvent; |
15 | 13 | import net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent; |
16 | 14 | import net.dv8tion.jda.api.events.message.MessageReceivedEvent; |
@@ -109,14 +107,9 @@ public void handleButton(@NotNull ButtonInteractionEvent event, @NotNull Button |
109 | 107 | } |
110 | 108 | } |
111 | 109 |
|
112 | | - private boolean isInvalidForumPost(@NotNull MessageChannelUnion union) { |
113 | | - return union.getType() != ChannelType.GUILD_PUBLIC_THREAD || |
114 | | - union.asThreadChannel().getParentChannel().getType() != ChannelType.FORUM; |
115 | | - } |
116 | | - |
117 | | - private boolean isInvalidForumPost(@NotNull ChannelUnion union) { |
118 | | - return union.getType() != ChannelType.GUILD_PUBLIC_THREAD || |
119 | | - union.asThreadChannel().getParentChannel().getType() != ChannelType.FORUM; |
| 110 | + private boolean isInvalidForumPost(@NotNull Channel channel) { |
| 111 | + return channel.getType() != ChannelType.GUILD_PUBLIC_THREAD || |
| 112 | + ((ThreadChannel) channel).getParentChannel().getType() != ChannelType.FORUM; |
120 | 113 | } |
121 | 114 |
|
122 | 115 | private boolean isInvalidHelpForumChannel(@NotNull ForumChannel forum) { |
|
0 commit comments