mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
refactor: remove user bot methods (#2559)
* [WIP] Remove user bots * more backend userbot removal * Add mfaEnabled back * revert client presences store removal * partially revert getAuth changes * remove more no longer used children of ClientUserGuildSettings * fix a bug with this pr and TextBasedChannel.applyToClass * remove a syncGuilds reference * more user bot data handling * various guildSync cleanup * bots can't call logout Had the user/bot portions of the code mixed up. Though, does this need to be a promise anymore? * make ClientManager#destroy() sync It nolonger needs to be a promise, and nothing depended on it being a promise that I can tell. * requested change * Fix massive error * no longer used as it's userbot only
This commit is contained in:
@@ -184,16 +184,12 @@ class GroupDMChannel extends Channel {
|
||||
* @param {Object} options Options for this method
|
||||
* @param {UserResolvable} options.user User to add to this Group DM
|
||||
* @param {string} [options.accessToken] Access token to use to add the user to this Group DM
|
||||
* (only available under a bot account)
|
||||
* @param {string} [options.nick] Permanent nickname to give the user (only available under a bot account)
|
||||
* @param {string} [options.nick] Permanent nickname to give the user
|
||||
* @returns {Promise<GroupDMChannel>}
|
||||
*/
|
||||
addUser({ user, accessToken, nick }) {
|
||||
const id = this.client.users.resolveID(user);
|
||||
const data = this.client.user.bot ?
|
||||
{ nick, access_token: accessToken } :
|
||||
{ recipient: id };
|
||||
return this.client.api.channels[this.id].recipients[id].put({ data })
|
||||
return this.client.api.channels[this.id].recipients[id].put({ nick, access_token: accessToken })
|
||||
.then(() => this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user