mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-12-26 17:18:29 +01:00
Fix mirroring support for non-text and thread channels
This commit is contained in:
parent
0906ef6c62
commit
b8f8b7d585
@ -473,14 +473,12 @@ public class DiscordMessageMirroringModule extends AbstractModule<DiscordSRV> {
|
||||
boolean webhookMessage,
|
||||
MirroringConfig config
|
||||
) {
|
||||
if (channel instanceof DiscordTextChannel) {
|
||||
DiscordTextChannel textChannel = (DiscordTextChannel) channel;
|
||||
return new MessageReference(textChannel, messageId, webhookMessage, config);
|
||||
} else if (channel instanceof DiscordThreadChannel) {
|
||||
if (channel instanceof DiscordThreadChannel) {
|
||||
DiscordThreadChannel threadChannel = (DiscordThreadChannel) channel;
|
||||
return new MessageReference(threadChannel, messageId, webhookMessage, config);
|
||||
} else {
|
||||
return new MessageReference(channel, messageId, webhookMessage, config);
|
||||
}
|
||||
throw new IllegalStateException("Unexpected channel type: " + channel.getClass().getName());
|
||||
}
|
||||
|
||||
private static class MirrorOperation {
|
||||
@ -549,12 +547,12 @@ public class DiscordMessageMirroringModule extends AbstractModule<DiscordSRV> {
|
||||
private final MirroringConfig config;
|
||||
|
||||
public MessageReference(
|
||||
DiscordTextChannel textChannel,
|
||||
DiscordMessageChannel messageChannel,
|
||||
long messageId,
|
||||
boolean webhookMessage,
|
||||
MirroringConfig config
|
||||
) {
|
||||
this(textChannel.getId(), -1L, messageId, webhookMessage, config);
|
||||
this(messageChannel.getId(), -1L, messageId, webhookMessage, config);
|
||||
}
|
||||
|
||||
public MessageReference(
|
||||
|
Loading…
Reference in New Issue
Block a user