mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01: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:
committed by
Schuyler Cebulskie
parent
f4724d61b2
commit
8da915f6a1
@@ -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>}
|
||||
|
||||
Reference in New Issue
Block a user