mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-12-28 17:37:52 +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,
|
boolean webhookMessage,
|
||||||
MirroringConfig config
|
MirroringConfig config
|
||||||
) {
|
) {
|
||||||
if (channel instanceof DiscordTextChannel) {
|
if (channel instanceof DiscordThreadChannel) {
|
||||||
DiscordTextChannel textChannel = (DiscordTextChannel) channel;
|
|
||||||
return new MessageReference(textChannel, messageId, webhookMessage, config);
|
|
||||||
} else if (channel instanceof DiscordThreadChannel) {
|
|
||||||
DiscordThreadChannel threadChannel = (DiscordThreadChannel) channel;
|
DiscordThreadChannel threadChannel = (DiscordThreadChannel) channel;
|
||||||
return new MessageReference(threadChannel, messageId, webhookMessage, config);
|
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 {
|
private static class MirrorOperation {
|
||||||
@ -549,12 +547,12 @@ public class DiscordMessageMirroringModule extends AbstractModule<DiscordSRV> {
|
|||||||
private final MirroringConfig config;
|
private final MirroringConfig config;
|
||||||
|
|
||||||
public MessageReference(
|
public MessageReference(
|
||||||
DiscordTextChannel textChannel,
|
DiscordMessageChannel messageChannel,
|
||||||
long messageId,
|
long messageId,
|
||||||
boolean webhookMessage,
|
boolean webhookMessage,
|
||||||
MirroringConfig config
|
MirroringConfig config
|
||||||
) {
|
) {
|
||||||
this(textChannel.getId(), -1L, messageId, webhookMessage, config);
|
this(messageChannel.getId(), -1L, messageId, webhookMessage, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MessageReference(
|
public MessageReference(
|
||||||
|
Loading…
Reference in New Issue
Block a user