mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-04 10:00:08 +00:00
fix: only return DMChannel that have the user as known recipient (#11478)
This commit is contained in:
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user