mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 13:02:38 +00:00
add User#dmChannel (#1005)
* add User#DMChannel * Update User.js * Update User.js
This commit is contained in:
parent
e392107369
commit
84503c8877
1 changed files with 8 additions and 0 deletions
|
|
@ -164,6 +164,14 @@ class User {
|
|||
return channel._typing.has(this.id) ? channel._typing.get(this.id).elapsedTime : -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* The DM between the client's user and this user
|
||||
* @type {?DMChannel}
|
||||
*/
|
||||
get dmChannel() {
|
||||
return this.client.channels.filter(c => c.type === 'dm').find(c => c.recipient.id === this.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a DM channel (if one exists) between the client and the user. Resolves with the channel if successful.
|
||||
* @returns {Promise<DMChannel>}
|
||||
|
|
|
|||
Loading…
Reference in a new issue