mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2025-01-11 19:50:59 +01:00
Fix mirroring sending to the same thread multiple times when misconfigured as channel id and thread
This commit is contained in:
parent
6d4adebfd3
commit
f0c5c7f1af
@ -172,14 +172,17 @@ public class DiscordMessageMirroringModule extends AbstractModule<DiscordSRV> {
|
||||
}
|
||||
|
||||
CompletableFutureUtil.combine(futures).whenComplete((lists, t) -> {
|
||||
Set<Long> channelIdsHandled = new HashSet<>();
|
||||
for (MirrorOperation operation : lists) {
|
||||
List<CompletableFuture<MirroredMessage>> mirrorFutures = new ArrayList<>();
|
||||
|
||||
for (MirrorTarget target : operation.targets) {
|
||||
DiscordGuildMessageChannel mirrorChannel = target.targetChannel;
|
||||
if (mirrorChannel.getId() == event.getChannel().getId()) {
|
||||
long channelId = mirrorChannel.getId();
|
||||
if (channelId == event.getChannel().getId() || channelIdsHandled.contains(channelId)) {
|
||||
continue;
|
||||
}
|
||||
channelIdsHandled.add(channelId);
|
||||
|
||||
MirroringConfig config = target.config;
|
||||
MirroringConfig.AttachmentConfig attachmentConfig = config.attachments;
|
||||
|
Loading…
Reference in New Issue
Block a user