fix: only return DMChannel that have the user as known recipient (#11478)

This commit is contained in:
Qjuh
2026-04-03 21:19:26 +02:00
committed by GitHub
parent 6a0cd82566
commit 67566d0b0e

View File

@@ -45,7 +45,9 @@ class UserManager extends CachedManager {
return (
this.client.channels.cache.find(
channel =>
channel.type === ChannelType.DM && channel.recipientIds.every(id => expectedRecipientIds.includes(id)),
channel.type === ChannelType.DM &&
channel.recipientId === userId &&
channel.recipientIds.every(id => expectedRecipientIds.includes(id)),
) ?? null
);
}