|
7 | 7 | import net.dv8tion.jda.api.entities.MessageEmbed; |
8 | 8 | import net.dv8tion.jda.api.entities.User; |
9 | 9 | import net.dv8tion.jda.api.entities.channel.concrete.ForumChannel; |
10 | | -import net.dv8tion.jda.api.entities.channel.concrete.TextChannel; |
11 | 10 | import net.dv8tion.jda.api.entities.channel.forums.ForumPost; |
12 | 11 | import net.dv8tion.jda.api.entities.channel.forums.ForumTag; |
13 | 12 | import net.dv8tion.jda.api.entities.channel.forums.ForumTagSnowflake; |
| 13 | +import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel; |
14 | 14 | import net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion; |
15 | 15 | import net.dv8tion.jda.api.events.interaction.ModalInteractionEvent; |
16 | 16 | import net.dv8tion.jda.api.events.interaction.command.MessageContextInteractionEvent; |
|
36 | 36 |
|
37 | 37 | import java.awt.Color; |
38 | 38 | import java.util.List; |
39 | | -import java.util.Objects; |
40 | 39 | import java.util.Optional; |
41 | 40 | import java.util.function.Consumer; |
42 | 41 | import java.util.function.Function; |
@@ -252,10 +251,7 @@ private RestAction<Message> dmUser(MessageChannelUnion sourceChannel, |
252 | 251 | } |
253 | 252 |
|
254 | 253 | private RestAction<Void> deleteOriginalMessage(JDA jda, String channelId, String messageId) { |
255 | | - TextChannel sourceChannel = Objects.requireNonNull(jda.getTextChannelById(channelId), |
256 | | - "Source channel could not be found for transfer-question feature"); |
257 | | - |
258 | | - return sourceChannel.deleteMessageById(messageId); |
| 254 | + return jda.getChannelById(MessageChannel.class, channelId).deleteMessageById(messageId); |
259 | 255 | } |
260 | 256 |
|
261 | 257 | private ForumChannel getHelperForum(JDA jda) { |
|
0 commit comments