mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 20:43:30 +01:00
add User#dmChannel (#1005)
* add User#DMChannel * Update User.js * Update User.js
This commit is contained in:
@@ -164,6 +164,14 @@ class User {
|
|||||||
return channel._typing.has(this.id) ? channel._typing.get(this.id).elapsedTime : -1;
|
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.
|
* Deletes a DM channel (if one exists) between the client and the user. Resolves with the channel if successful.
|
||||||
* @returns {Promise<DMChannel>}
|
* @returns {Promise<DMChannel>}
|
||||||
|
|||||||
Reference in New Issue
Block a user