mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Remove double iteration (#2773)
This commit is contained in:
@@ -185,7 +185,7 @@ class User extends Base {
|
||||
* @readonly
|
||||
*/
|
||||
get dmChannel() {
|
||||
return this.client.channels.filter(c => c.type === 'dm').find(c => c.recipient.id === this.id) || null;
|
||||
return this.client.channels.find(c => c.type === 'dm' && c.recipient.id === this.id) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user