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:
bdistin
2018-07-25 21:14:23 -05:00
committed by Isabella
parent f963621ef1
commit 5afd77ab73
34 changed files with 15 additions and 1103 deletions

View File

@@ -21,7 +21,6 @@ const browser = exports.browser = typeof window !== 'undefined';
* @property {boolean} [fetchAllMembers=false] Whether to cache all guild members and users upon startup, as well as
* upon joining a guild (should be avoided whenever possible)
* @property {boolean} [disableEveryone=false] Default value for {@link MessageOptions#disableEveryone}
* @property {boolean} [sync=false] Whether to periodically sync guilds (for user accounts)
* @property {number} [restWsBridgeTimeout=5000] Maximum time permitted between REST responses and their
* corresponding websocket events
* @property {number} [restTimeOffset=500] Extra time in millseconds to wait before continuing to make REST
@@ -46,7 +45,6 @@ exports.DefaultOptions = {
messageSweepInterval: 0,
fetchAllMembers: false,
disableEveryone: false,
sync: false,
restWsBridgeTimeout: 5000,
disabledEvents: [],
restTimeOffset: 500,
@@ -246,7 +244,6 @@ exports.Events = {
USER_UPDATE: 'userUpdate',
USER_NOTE_UPDATE: 'userNoteUpdate',
USER_SETTINGS_UPDATE: 'clientUserSettingsUpdate',
USER_GUILD_SETTINGS_UPDATE: 'clientUserGuildSettingsUpdate',
PRESENCE_UPDATE: 'presenceUpdate',
VOICE_STATE_UPDATE: 'voiceStateUpdate',
VOICE_BROADCAST_SUBSCRIBE: 'subscribe',
@@ -264,7 +261,6 @@ exports.Events = {
* The type of a websocket message event, e.g. `MESSAGE_CREATE`. Here are the available events:
* * READY
* * RESUMED
* * GUILD_SYNC
* * GUILD_CREATE
* * GUILD_DELETE
* * GUILD_UPDATE
@@ -302,7 +298,6 @@ exports.Events = {
exports.WSEvents = keyMirror([
'READY',
'RESUMED',
'GUILD_SYNC',
'GUILD_CREATE',
'GUILD_DELETE',
'GUILD_UPDATE',
@@ -328,15 +323,10 @@ exports.WSEvents = keyMirror([
'MESSAGE_REACTION_REMOVE',
'MESSAGE_REACTION_REMOVE_ALL',
'USER_UPDATE',
'USER_NOTE_UPDATE',
'USER_SETTINGS_UPDATE',
'USER_GUILD_SETTINGS_UPDATE',
'PRESENCE_UPDATE',
'VOICE_STATE_UPDATE',
'TYPING_START',
'VOICE_SERVER_UPDATE',
'RELATIONSHIP_ADD',
'RELATIONSHIP_REMOVE',
]);
/**
@@ -392,13 +382,6 @@ exports.ExplicitContentFilterTypes = [
'FRIENDS_AND_NON_FRIENDS',
];
exports.MessageNotificationTypes = [
'EVERYTHING',
'MENTIONS',
'NOTHING',
'INHERIT',
];
exports.UserSettingsMap = {
/**
* Automatically convert emoticons in your messages to emoji,
@@ -532,60 +515,6 @@ exports.UserSettingsMap = {
},
};
exports.UserGuildSettingsMap = {
message_notifications: function messageNotifications(type) { // eslint-disable-line func-name-matching
/**
* The type of message that should notify you.
* One of `EVERYTHING`, `MENTIONS`, `NOTHING`
* @name ClientUserGuildSettings#messageNotifications
* @type {string}
*/
return exports.MessageNotificationTypes[type];
},
/**
* Whether to receive mobile push notifications
* @name ClientUserGuildSettings#mobilePush
* @type {boolean}
*/
mobile_push: 'mobilePush',
/**
* Whether the guild is muted or not
* @name ClientUserGuildSettings#muted
* @type {boolean}
*/
muted: 'muted',
/**
* Whether to suppress everyone messages
* @name ClientUserGuildSettings#suppressEveryone
* @type {boolean}
*/
suppress_everyone: 'suppressEveryone',
/**
* A collection containing all the channel overrides
* @name ClientUserGuildSettings#channelOverrides
* @type {Collection<ClientUserChannelOverride>}
*/
channel_overrides: 'channelOverrides',
};
exports.UserChannelOverrideMap = {
message_notifications: function messageNotifications(type) { // eslint-disable-line func-name-matching
/**
* The type of message that should notify you.
* One of `EVERYTHING`, `MENTIONS`, `NOTHING`, `INHERIT`
* @name ClientUserChannelOverride#messageNotifications
* @type {string}
*/
return exports.MessageNotificationTypes[type];
},
/**
* Whether the channel is muted or not
* @name ClientUserChannelOverride#muted
* @type {boolean}
*/
muted: 'muted',
};
/**
* All flags users can have:
* * STAFF