mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 14:41:36 +00:00
expose createDM (#1151)
* expose createDM * Update User.js * in v12 we are removing these, kay? * Update GuildMember.js * Update User.js
This commit is contained in:
parent
f4724d61b2
commit
8da915f6a1
2 changed files with 17 additions and 1 deletions
|
|
@ -395,12 +395,20 @@ class GuildMember {
|
|||
return this.edit({ nick });
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a DM channel between the client and the member
|
||||
* @returns {Promise<DMChannel>}
|
||||
*/
|
||||
createDM() {
|
||||
return this.user.createDM();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes any DMs with this guild member
|
||||
* @returns {Promise<DMChannel>}
|
||||
*/
|
||||
deleteDM() {
|
||||
return this.client.rest.methods.deleteChannel(this);
|
||||
return this.user.deleteDM();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -179,6 +179,14 @@ class User {
|
|||
return this.client.channels.filter(c => c.type === 'dm').find(c => c.recipient.id === this.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a DM channel between the client and the user
|
||||
* @returns {Promise<DMChannel>}
|
||||
*/
|
||||
createDM() {
|
||||
return this.client.rest.methods.createDM(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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