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:
@@ -1,6 +1,5 @@
|
||||
const TextBasedChannel = require('./interfaces/TextBasedChannel');
|
||||
const { Presence } = require('./Presence');
|
||||
const UserProfile = require('./UserProfile');
|
||||
const Snowflake = require('../util/Snowflake');
|
||||
const Base = require('./Base');
|
||||
const { Error } = require('../errors');
|
||||
@@ -151,16 +150,6 @@ class User extends Base {
|
||||
return `${this.username}#${this.discriminator}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* The note that is set for the user
|
||||
* <warn>This is only available when using a user account.</warn>
|
||||
* @type {?string}
|
||||
* @readonly
|
||||
*/
|
||||
get note() {
|
||||
return this.client.user.notes.get(this.id) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the user is typing in a channel.
|
||||
* @param {ChannelResolvable} channel The channel to check in
|
||||
@@ -222,26 +211,6 @@ class User extends Base {
|
||||
.then(data => this.client.actions.ChannelDelete.handle(data).channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the profile of the user.
|
||||
* <warn>This is only available when using a user account.</warn>
|
||||
* @returns {Promise<UserProfile>}
|
||||
*/
|
||||
fetchProfile() {
|
||||
return this.client.api.users(this.id).profile.get().then(data => new UserProfile(this, data));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a note for the user.
|
||||
* <warn>This is only available when using a user account.</warn>
|
||||
* @param {string} note The note to set for the user
|
||||
* @returns {Promise<User>}
|
||||
*/
|
||||
setNote(note) {
|
||||
return this.client.api.users('@me').notes(this.id).put({ data: { note } })
|
||||
.then(() => this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the user is equal to another. It compares ID, username, discriminator, avatar, and bot flags.
|
||||
* It is recommended to compare equality by using `user.id === user2.id` unless you want to compare all properties.
|
||||
|
||||
Reference in New Issue
Block a user