From d35e0862e6b60fe3c4f823371627359f3ce3e68b Mon Sep 17 00:00:00 2001 From: Alee14 Date: Fri, 28 Jul 2017 16:20:27 -0400 Subject: Removing node modules (go get them yourself :P) --- .../discord.js/src/client/actions/Action.js | 23 ---------- .../src/client/actions/ActionsManager.js | 38 ---------------- .../discord.js/src/client/actions/ChannelCreate.js | 13 ------ .../discord.js/src/client/actions/ChannelDelete.js | 31 ------------- .../discord.js/src/client/actions/ChannelUpdate.js | 34 --------------- .../src/client/actions/GuildBanRemove.js | 13 ------ .../discord.js/src/client/actions/GuildDelete.js | 51 ---------------------- .../src/client/actions/GuildEmojiCreate.js | 18 -------- .../src/client/actions/GuildEmojiDelete.js | 18 -------- .../src/client/actions/GuildEmojiUpdate.js | 15 ------- .../src/client/actions/GuildMemberGet.js | 12 ----- .../src/client/actions/GuildMemberRemove.js | 49 --------------------- .../src/client/actions/GuildRoleCreate.js | 32 -------------- .../src/client/actions/GuildRoleDelete.js | 46 ------------------- .../src/client/actions/GuildRoleUpdate.js | 41 ----------------- .../src/client/actions/GuildRolesPositionUpdate.js | 23 ---------- .../discord.js/src/client/actions/GuildSync.js | 27 ------------ .../discord.js/src/client/actions/GuildUpdate.js | 34 --------------- .../discord.js/src/client/actions/MessageCreate.js | 40 ----------------- .../discord.js/src/client/actions/MessageDelete.js | 40 ----------------- .../src/client/actions/MessageDeleteBulk.js | 24 ---------- .../src/client/actions/MessageReactionAdd.js | 43 ------------------ .../src/client/actions/MessageReactionRemove.js | 43 ------------------ .../src/client/actions/MessageReactionRemoveAll.js | 25 ----------- .../discord.js/src/client/actions/MessageUpdate.js | 43 ------------------ .../discord.js/src/client/actions/UserGet.js | 13 ------ .../src/client/actions/UserNoteUpdate.js | 30 ------------- .../discord.js/src/client/actions/UserUpdate.js | 33 -------------- 28 files changed, 852 deletions(-) delete mode 100644 node_modules/discord.js/src/client/actions/Action.js delete mode 100644 node_modules/discord.js/src/client/actions/ActionsManager.js delete mode 100644 node_modules/discord.js/src/client/actions/ChannelCreate.js delete mode 100644 node_modules/discord.js/src/client/actions/ChannelDelete.js delete mode 100644 node_modules/discord.js/src/client/actions/ChannelUpdate.js delete mode 100644 node_modules/discord.js/src/client/actions/GuildBanRemove.js delete mode 100644 node_modules/discord.js/src/client/actions/GuildDelete.js delete mode 100644 node_modules/discord.js/src/client/actions/GuildEmojiCreate.js delete mode 100644 node_modules/discord.js/src/client/actions/GuildEmojiDelete.js delete mode 100644 node_modules/discord.js/src/client/actions/GuildEmojiUpdate.js delete mode 100644 node_modules/discord.js/src/client/actions/GuildMemberGet.js delete mode 100644 node_modules/discord.js/src/client/actions/GuildMemberRemove.js delete mode 100644 node_modules/discord.js/src/client/actions/GuildRoleCreate.js delete mode 100644 node_modules/discord.js/src/client/actions/GuildRoleDelete.js delete mode 100644 node_modules/discord.js/src/client/actions/GuildRoleUpdate.js delete mode 100644 node_modules/discord.js/src/client/actions/GuildRolesPositionUpdate.js delete mode 100644 node_modules/discord.js/src/client/actions/GuildSync.js delete mode 100644 node_modules/discord.js/src/client/actions/GuildUpdate.js delete mode 100644 node_modules/discord.js/src/client/actions/MessageCreate.js delete mode 100644 node_modules/discord.js/src/client/actions/MessageDelete.js delete mode 100644 node_modules/discord.js/src/client/actions/MessageDeleteBulk.js delete mode 100644 node_modules/discord.js/src/client/actions/MessageReactionAdd.js delete mode 100644 node_modules/discord.js/src/client/actions/MessageReactionRemove.js delete mode 100644 node_modules/discord.js/src/client/actions/MessageReactionRemoveAll.js delete mode 100644 node_modules/discord.js/src/client/actions/MessageUpdate.js delete mode 100644 node_modules/discord.js/src/client/actions/UserGet.js delete mode 100644 node_modules/discord.js/src/client/actions/UserNoteUpdate.js delete mode 100644 node_modules/discord.js/src/client/actions/UserUpdate.js (limited to 'node_modules/discord.js/src/client/actions') diff --git a/node_modules/discord.js/src/client/actions/Action.js b/node_modules/discord.js/src/client/actions/Action.js deleted file mode 100644 index 8fdadc9..0000000 --- a/node_modules/discord.js/src/client/actions/Action.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - -ABOUT ACTIONS - -Actions are similar to WebSocket Packet Handlers, but since introducing -the REST API methods, in order to prevent rewriting code to handle data, -"actions" have been introduced. They're basically what Packet Handlers -used to be but they're strictly for manipulating data and making sure -that WebSocket events don't clash with REST methods. - -*/ - -class GenericAction { - constructor(client) { - this.client = client; - } - - handle(data) { - return data; - } -} - -module.exports = GenericAction; diff --git a/node_modules/discord.js/src/client/actions/ActionsManager.js b/node_modules/discord.js/src/client/actions/ActionsManager.js deleted file mode 100644 index ac95aa7..0000000 --- a/node_modules/discord.js/src/client/actions/ActionsManager.js +++ /dev/null @@ -1,38 +0,0 @@ -class ActionsManager { - constructor(client) { - this.client = client; - - this.register(require('./MessageCreate')); - this.register(require('./MessageDelete')); - this.register(require('./MessageDeleteBulk')); - this.register(require('./MessageUpdate')); - this.register(require('./MessageReactionAdd')); - this.register(require('./MessageReactionRemove')); - this.register(require('./MessageReactionRemoveAll')); - this.register(require('./ChannelCreate')); - this.register(require('./ChannelDelete')); - this.register(require('./ChannelUpdate')); - this.register(require('./GuildDelete')); - this.register(require('./GuildUpdate')); - this.register(require('./GuildMemberGet')); - this.register(require('./GuildMemberRemove')); - this.register(require('./GuildBanRemove')); - this.register(require('./GuildRoleCreate')); - this.register(require('./GuildRoleDelete')); - this.register(require('./GuildRoleUpdate')); - this.register(require('./UserGet')); - this.register(require('./UserUpdate')); - this.register(require('./UserNoteUpdate')); - this.register(require('./GuildSync')); - this.register(require('./GuildEmojiCreate')); - this.register(require('./GuildEmojiDelete')); - this.register(require('./GuildEmojiUpdate')); - this.register(require('./GuildRolesPositionUpdate')); - } - - register(Action) { - this[Action.name.replace(/Action$/, '')] = new Action(this.client); - } -} - -module.exports = ActionsManager; diff --git a/node_modules/discord.js/src/client/actions/ChannelCreate.js b/node_modules/discord.js/src/client/actions/ChannelCreate.js deleted file mode 100644 index dc47041..0000000 --- a/node_modules/discord.js/src/client/actions/ChannelCreate.js +++ /dev/null @@ -1,13 +0,0 @@ -const Action = require('./Action'); - -class ChannelCreateAction extends Action { - handle(data) { - const client = this.client; - const channel = client.dataManager.newChannel(data); - return { - channel, - }; - } -} - -module.exports = ChannelCreateAction; diff --git a/node_modules/discord.js/src/client/actions/ChannelDelete.js b/node_modules/discord.js/src/client/actions/ChannelDelete.js deleted file mode 100644 index 7b847ef..0000000 --- a/node_modules/discord.js/src/client/actions/ChannelDelete.js +++ /dev/null @@ -1,31 +0,0 @@ -const Action = require('./Action'); - -class ChannelDeleteAction extends Action { - constructor(client) { - super(client); - this.deleted = new Map(); - } - - handle(data) { - const client = this.client; - - let channel = client.channels.get(data.id); - if (channel) { - client.dataManager.killChannel(channel); - this.deleted.set(channel.id, channel); - this.scheduleForDeletion(channel.id); - } else { - channel = this.deleted.get(data.id) || null; - } - - return { - channel, - }; - } - - scheduleForDeletion(id) { - this.client.setTimeout(() => this.deleted.delete(id), this.client.options.restWsBridgeTimeout); - } -} - -module.exports = ChannelDeleteAction; diff --git a/node_modules/discord.js/src/client/actions/ChannelUpdate.js b/node_modules/discord.js/src/client/actions/ChannelUpdate.js deleted file mode 100644 index df50ed4..0000000 --- a/node_modules/discord.js/src/client/actions/ChannelUpdate.js +++ /dev/null @@ -1,34 +0,0 @@ -const Action = require('./Action'); -const Constants = require('../../util/Constants'); -const cloneObject = require('../../util/CloneObject'); - -class ChannelUpdateAction extends Action { - handle(data) { - const client = this.client; - - const channel = client.channels.get(data.id); - if (channel) { - const oldChannel = cloneObject(channel); - channel.setup(data); - client.emit(Constants.Events.CHANNEL_UPDATE, oldChannel, channel); - return { - old: oldChannel, - updated: channel, - }; - } - - return { - old: null, - updated: null, - }; - } -} - -/** - * Emitted whenever a channel is updated - e.g. name change, topic change. - * @event Client#channelUpdate - * @param {Channel} oldChannel The channel before the update - * @param {Channel} newChannel The channel after the update - */ - -module.exports = ChannelUpdateAction; diff --git a/node_modules/discord.js/src/client/actions/GuildBanRemove.js b/node_modules/discord.js/src/client/actions/GuildBanRemove.js deleted file mode 100644 index 0276a52..0000000 --- a/node_modules/discord.js/src/client/actions/GuildBanRemove.js +++ /dev/null @@ -1,13 +0,0 @@ -const Action = require('./Action'); -const Constants = require('../../util/Constants'); - -class GuildBanRemove extends Action { - handle(data) { - const client = this.client; - const guild = client.guilds.get(data.guild_id); - const user = client.dataManager.newUser(data.user); - if (guild && user) client.emit(Constants.Events.GUILD_BAN_REMOVE, guild, user); - } -} - -module.exports = GuildBanRemove; diff --git a/node_modules/discord.js/src/client/actions/GuildDelete.js b/node_modules/discord.js/src/client/actions/GuildDelete.js deleted file mode 100644 index 1214263..0000000 --- a/node_modules/discord.js/src/client/actions/GuildDelete.js +++ /dev/null @@ -1,51 +0,0 @@ -const Action = require('./Action'); -const Constants = require('../../util/Constants'); - -class GuildDeleteAction extends Action { - constructor(client) { - super(client); - this.deleted = new Map(); - } - - handle(data) { - const client = this.client; - - let guild = client.guilds.get(data.id); - if (guild) { - if (guild.available && data.unavailable) { - // guild is unavailable - guild.available = false; - client.emit(Constants.Events.GUILD_UNAVAILABLE, guild); - - // stops the GuildDelete packet thinking a guild was actually deleted, - // handles emitting of event itself - return { - guild: null, - }; - } - - // delete guild - client.guilds.delete(guild.id); - this.deleted.set(guild.id, guild); - this.scheduleForDeletion(guild.id); - } else { - guild = this.deleted.get(data.id) || null; - } - - return { - guild, - }; - } - - scheduleForDeletion(id) { - this.client.setTimeout(() => this.deleted.delete(id), this.client.options.restWsBridgeTimeout); - } -} - -/** - * Emitted whenever a guild becomes unavailable, likely due to a server outage. - * @event Client#guildUnavailable - * @param {Guild} guild The guild that has become unavailable. - */ - -module.exports = GuildDeleteAction; diff --git a/node_modules/discord.js/src/client/actions/GuildEmojiCreate.js b/node_modules/discord.js/src/client/actions/GuildEmojiCreate.js deleted file mode 100644 index 5df1ced..0000000 --- a/node_modules/discord.js/src/client/actions/GuildEmojiCreate.js +++ /dev/null @@ -1,18 +0,0 @@ -const Action = require('./Action'); - -class GuildEmojiCreateAction extends Action { - handle(guild, createdEmoji) { - const client = this.client; - const emoji = client.dataManager.newEmoji(createdEmoji, guild); - return { - emoji, - }; - } -} - -/** - * Emitted whenever a custom emoji is created in a guild - * @event Client#emojiCreate - * @param {Emoji} emoji The emoji that was created. - */ -module.exports = GuildEmojiCreateAction; diff --git a/node_modules/discord.js/src/client/actions/GuildEmojiDelete.js b/node_modules/discord.js/src/client/actions/GuildEmojiDelete.js deleted file mode 100644 index 8cfa205..0000000 --- a/node_modules/discord.js/src/client/actions/GuildEmojiDelete.js +++ /dev/null @@ -1,18 +0,0 @@ -const Action = require('./Action'); - -class GuildEmojiDeleteAction extends Action { - handle(emoji) { - const client = this.client; - client.dataManager.killEmoji(emoji); - return { - emoji, - }; - } -} - -/** - * Emitted whenever a custom guild emoji is deleted - * @event Client#emojiDelete - * @param {Emoji} emoji The emoji that was deleted. - */ -module.exports = GuildEmojiDeleteAction; diff --git a/node_modules/discord.js/src/client/actions/GuildEmojiUpdate.js b/node_modules/discord.js/src/client/actions/GuildEmojiUpdate.js deleted file mode 100644 index 94bfa24..0000000 --- a/node_modules/discord.js/src/client/actions/GuildEmojiUpdate.js +++ /dev/null @@ -1,15 +0,0 @@ -const Action = require('./Action'); - -class GuildEmojiUpdateAction extends Action { - handle(oldEmoji, newEmoji) { - this.client.dataManager.updateEmoji(oldEmoji, newEmoji); - } -} - -/** - * Emitted whenever a custom guild emoji is updated - * @event Client#emojiUpdate - * @param {Emoji} oldEmoji The old emoji - * @param {Emoji} newEmoji The new emoji - */ -module.exports = GuildEmojiUpdateAction; diff --git a/node_modules/discord.js/src/client/actions/GuildMemberGet.js b/node_modules/discord.js/src/client/actions/GuildMemberGet.js deleted file mode 100644 index b00fa0f..0000000 --- a/node_modules/discord.js/src/client/actions/GuildMemberGet.js +++ /dev/null @@ -1,12 +0,0 @@ -const Action = require('./Action'); - -class GuildMemberGetAction extends Action { - handle(guild, data) { - const member = guild._addMember(data, false); - return { - member, - }; - } -} - -module.exports = GuildMemberGetAction; diff --git a/node_modules/discord.js/src/client/actions/GuildMemberRemove.js b/node_modules/discord.js/src/client/actions/GuildMemberRemove.js deleted file mode 100644 index d68b8b5..0000000 --- a/node_modules/discord.js/src/client/actions/GuildMemberRemove.js +++ /dev/null @@ -1,49 +0,0 @@ -const Action = require('./Action'); -const Constants = require('../../util/Constants'); - -class GuildMemberRemoveAction extends Action { - constructor(client) { - super(client); - this.deleted = new Map(); - } - - handle(data) { - const client = this.client; - - const guild = client.guilds.get(data.guild_id); - if (guild) { - let member = guild.members.get(data.user.id); - if (member) { - guild.memberCount--; - guild._removeMember(member); - this.deleted.set(guild.id + data.user.id, member); - if (client.status === Constants.Status.READY) client.emit(Constants.Events.GUILD_MEMBER_REMOVE, member); - this.scheduleForDeletion(guild.id, data.user.id); - } else { - member = this.deleted.get(guild.id + data.user.id) || null; - } - - return { - guild, - member, - }; - } - - return { - guild, - member: null, - }; - } - - scheduleForDeletion(guildID, userID) { - this.client.setTimeout(() => this.deleted.delete(guildID + userID), this.client.options.restWsBridgeTimeout); - } -} - -/** - * Emitted whenever a member leaves a guild, or is kicked. - * @event Client#guildMemberRemove - * @param {GuildMember} member The member that has left/been kicked from the guild. - */ - -module.exports = GuildMemberRemoveAction; diff --git a/node_modules/discord.js/src/client/actions/GuildRoleCreate.js b/node_modules/discord.js/src/client/actions/GuildRoleCreate.js deleted file mode 100644 index 82ea19a..0000000 --- a/node_modules/discord.js/src/client/actions/GuildRoleCreate.js +++ /dev/null @@ -1,32 +0,0 @@ -const Action = require('./Action'); -const Constants = require('../../util/Constants'); -const Role = require('../../structures/Role'); - -class GuildRoleCreate extends Action { - handle(data) { - const client = this.client; - - const guild = client.guilds.get(data.guild_id); - if (guild) { - const already = guild.roles.has(data.role.id); - const role = new Role(guild, data.role); - guild.roles.set(role.id, role); - if (!already) client.emit(Constants.Events.GUILD_ROLE_CREATE, role); - return { - role, - }; - } - - return { - role: null, - }; - } -} - -/** - * Emitted whenever a role is created. - * @event Client#roleCreate - * @param {Role} role The role that was created. - */ - -module.exports = GuildRoleCreate; diff --git a/node_modules/discord.js/src/client/actions/GuildRoleDelete.js b/node_modules/discord.js/src/client/actions/GuildRoleDelete.js deleted file mode 100644 index eeaa1e9..0000000 --- a/node_modules/discord.js/src/client/actions/GuildRoleDelete.js +++ /dev/null @@ -1,46 +0,0 @@ -const Action = require('./Action'); -const Constants = require('../../util/Constants'); - -class GuildRoleDeleteAction extends Action { - constructor(client) { - super(client); - this.deleted = new Map(); - } - - handle(data) { - const client = this.client; - - const guild = client.guilds.get(data.guild_id); - if (guild) { - let role = guild.roles.get(data.role_id); - if (role) { - guild.roles.delete(data.role_id); - this.deleted.set(guild.id + data.role_id, role); - this.scheduleForDeletion(guild.id, data.role_id); - client.emit(Constants.Events.GUILD_ROLE_DELETE, role); - } else { - role = this.deleted.get(guild.id + data.role_id) || null; - } - - return { - role, - }; - } - - return { - role: null, - }; - } - - scheduleForDeletion(guildID, roleID) { - this.client.setTimeout(() => this.deleted.delete(guildID + roleID), this.client.options.restWsBridgeTimeout); - } -} - -/** - * Emitted whenever a guild role is deleted. - * @event Client#roleDelete - * @param {Role} role The role that was deleted. - */ - -module.exports = GuildRoleDeleteAction; diff --git a/node_modules/discord.js/src/client/actions/GuildRoleUpdate.js b/node_modules/discord.js/src/client/actions/GuildRoleUpdate.js deleted file mode 100644 index 8270517..0000000 --- a/node_modules/discord.js/src/client/actions/GuildRoleUpdate.js +++ /dev/null @@ -1,41 +0,0 @@ -const Action = require('./Action'); -const Constants = require('../../util/Constants'); -const cloneObject = require('../../util/CloneObject'); - -class GuildRoleUpdateAction extends Action { - handle(data) { - const client = this.client; - - const guild = client.guilds.get(data.guild_id); - if (guild) { - const roleData = data.role; - let oldRole = null; - - const role = guild.roles.get(roleData.id); - if (role) { - oldRole = cloneObject(role); - role.setup(data.role); - client.emit(Constants.Events.GUILD_ROLE_UPDATE, oldRole, role); - } - - return { - old: oldRole, - updated: role, - }; - } - - return { - old: null, - updated: null, - }; - } -} - -/** - * Emitted whenever a guild role is updated. - * @event Client#roleUpdate - * @param {Role} oldRole The role before the update. - * @param {Role} newRole The role after the update. - */ - -module.exports = GuildRoleUpdateAction; diff --git a/node_modules/discord.js/src/client/actions/GuildRolesPositionUpdate.js b/node_modules/discord.js/src/client/actions/GuildRolesPositionUpdate.js deleted file mode 100644 index a95c923..0000000 --- a/node_modules/discord.js/src/client/actions/GuildRolesPositionUpdate.js +++ /dev/null @@ -1,23 +0,0 @@ -const Action = require('./Action'); - -class GuildRolesPositionUpdate extends Action { - handle(data) { - const client = this.client; - - const guild = client.guilds.get(data.guild_id); - if (guild) { - for (const partialRole of data.roles) { - const role = guild.roles.get(partialRole.id); - if (role) { - role.position = partialRole.position; - } - } - } - - return { - guild, - }; - } -} - -module.exports = GuildRolesPositionUpdate; diff --git a/node_modules/discord.js/src/client/actions/GuildSync.js b/node_modules/discord.js/src/client/actions/GuildSync.js deleted file mode 100644 index 7b94ec8..0000000 --- a/node_modules/discord.js/src/client/actions/GuildSync.js +++ /dev/null @@ -1,27 +0,0 @@ -const Action = require('./Action'); - -class GuildSync extends Action { - handle(data) { - const client = this.client; - - const guild = client.guilds.get(data.id); - if (guild) { - data.presences = data.presences || []; - for (const presence of data.presences) { - guild._setPresence(presence.user.id, presence); - } - - data.members = data.members || []; - for (const syncMember of data.members) { - const member = guild.members.get(syncMember.user.id); - if (member) { - guild._updateMember(member, syncMember); - } else { - guild._addMember(syncMember, false); - } - } - } - } -} - -module.exports = GuildSync; diff --git a/node_modules/discord.js/src/client/actions/GuildUpdate.js b/node_modules/discord.js/src/client/actions/GuildUpdate.js deleted file mode 100644 index efda7f7..0000000 --- a/node_modules/discord.js/src/client/actions/GuildUpdate.js +++ /dev/null @@ -1,34 +0,0 @@ -const Action = require('./Action'); -const Constants = require('../../util/Constants'); -const cloneObject = require('../../util/CloneObject'); - -class GuildUpdateAction extends Action { - handle(data) { - const client = this.client; - - const guild = client.guilds.get(data.id); - if (guild) { - const oldGuild = cloneObject(guild); - guild.setup(data); - client.emit(Constants.Events.GUILD_UPDATE, oldGuild, guild); - return { - old: oldGuild, - updated: guild, - }; - } - - return { - old: null, - updated: null, - }; - } -} - -/** - * Emitted whenever a guild is updated - e.g. name change. - * @event Client#guildUpdate - * @param {Guild} oldGuild The guild before the update. - * @param {Guild} newGuild The guild after the update. - */ - -module.exports = GuildUpdateAction; diff --git a/node_modules/discord.js/src/client/actions/MessageCreate.js b/node_modules/discord.js/src/client/actions/MessageCreate.js deleted file mode 100644 index 00fc1e9..0000000 --- a/node_modules/discord.js/src/client/actions/MessageCreate.js +++ /dev/null @@ -1,40 +0,0 @@ -const Action = require('./Action'); -const Message = require('../../structures/Message'); - -class MessageCreateAction extends Action { - handle(data) { - const client = this.client; - - const channel = client.channels.get((data instanceof Array ? data[0] : data).channel_id); - const user = client.users.get((data instanceof Array ? data[0] : data).author.id); - if (channel) { - const member = channel.guild ? channel.guild.member(user) : null; - if (data instanceof Array) { - const messages = new Array(data.length); - for (let i = 0; i < data.length; i++) { - messages[i] = channel._cacheMessage(new Message(channel, data[i], client)); - } - channel.lastMessageID = messages[messages.length - 1].id; - if (user) user.lastMessageID = messages[messages.length - 1].id; - if (member) member.lastMessageID = messages[messages.length - 1].id; - return { - messages, - }; - } else { - const message = channel._cacheMessage(new Message(channel, data, client)); - channel.lastMessageID = data.id; - if (user) user.lastMessageID = data.id; - if (member) member.lastMessageID = data.id; - return { - message, - }; - } - } - - return { - message: null, - }; - } -} - -module.exports = MessageCreateAction; diff --git a/node_modules/discord.js/src/client/actions/MessageDelete.js b/node_modules/discord.js/src/client/actions/MessageDelete.js deleted file mode 100644 index beb8050..0000000 --- a/node_modules/discord.js/src/client/actions/MessageDelete.js +++ /dev/null @@ -1,40 +0,0 @@ -const Action = require('./Action'); - -class MessageDeleteAction extends Action { - constructor(client) { - super(client); - this.deleted = new Map(); - } - - handle(data) { - const client = this.client; - - const channel = client.channels.get(data.channel_id); - if (channel) { - let message = channel.messages.get(data.id); - - if (message) { - channel.messages.delete(message.id); - this.deleted.set(channel.id + message.id, message); - this.scheduleForDeletion(channel.id, message.id); - } else { - message = this.deleted.get(channel.id + data.id) || null; - } - - return { - message, - }; - } - - return { - message: null, - }; - } - - scheduleForDeletion(channelID, messageID) { - this.client.setTimeout(() => this.deleted.delete(channelID + messageID), - this.client.options.restWsBridgeTimeout); - } -} - -module.exports = MessageDeleteAction; diff --git a/node_modules/discord.js/src/client/actions/MessageDeleteBulk.js b/node_modules/discord.js/src/client/actions/MessageDeleteBulk.js deleted file mode 100644 index 6a12ef1..0000000 --- a/node_modules/discord.js/src/client/actions/MessageDeleteBulk.js +++ /dev/null @@ -1,24 +0,0 @@ -const Action = require('./Action'); -const Collection = require('../../util/Collection'); -const Constants = require('../../util/Constants'); - -class MessageDeleteBulkAction extends Action { - handle(data) { - const client = this.client; - const channel = client.channels.get(data.channel_id); - - const ids = data.ids; - const messages = new Collection(); - for (const id of ids) { - const message = channel.messages.get(id); - if (message) messages.set(message.id, message); - } - - if (messages.size > 0) client.emit(Constants.Events.MESSAGE_BULK_DELETE, messages); - return { - messages, - }; - } -} - -module.exports = MessageDeleteBulkAction; diff --git a/node_modules/discord.js/src/client/actions/MessageReactionAdd.js b/node_modules/discord.js/src/client/actions/MessageReactionAdd.js deleted file mode 100644 index f57ec2e..0000000 --- a/node_modules/discord.js/src/client/actions/MessageReactionAdd.js +++ /dev/null @@ -1,43 +0,0 @@ -const Action = require('./Action'); -const Constants = require('../../util/Constants'); - -/* -{ user_id: 'id', - message_id: 'id', - emoji: { name: '�', id: null }, - channel_id: 'id' } } -*/ - -class MessageReactionAdd extends Action { - handle(data) { - const user = this.client.users.get(data.user_id); - if (!user) return false; - - const channel = this.client.channels.get(data.channel_id); - if (!channel || channel.type === 'voice') return false; - - const message = channel.messages.get(data.message_id); - if (!message) return false; - - if (!data.emoji) return false; - - const reaction = message._addReaction(data.emoji, user); - - if (reaction) { - this.client.emit(Constants.Events.MESSAGE_REACTION_ADD, reaction, user); - } - - return { - message, - reaction, - user, - }; - } -} -/** - * Emitted whenever a reaction is added to a message. - * @event Client#messageReactionAdd - * @param {MessageReaction} messageReaction The reaction object. - * @param {User} user The user that applied the emoji or reaction emoji. - */ -module.exports = MessageReactionAdd; diff --git a/node_modules/discord.js/src/client/actions/MessageReactionRemove.js b/node_modules/discord.js/src/client/actions/MessageReactionRemove.js deleted file mode 100644 index 98a958d..0000000 --- a/node_modules/discord.js/src/client/actions/MessageReactionRemove.js +++ /dev/null @@ -1,43 +0,0 @@ -const Action = require('./Action'); -const Constants = require('../../util/Constants'); - -/* -{ user_id: 'id', - message_id: 'id', - emoji: { name: '�', id: null }, - channel_id: 'id' } } -*/ - -class MessageReactionRemove extends Action { - handle(data) { - const user = this.client.users.get(data.user_id); - if (!user) return false; - - const channel = this.client.channels.get(data.channel_id); - if (!channel || channel.type === 'voice') return false; - - const message = channel.messages.get(data.message_id); - if (!message) return false; - - if (!data.emoji) return false; - - const reaction = message._removeReaction(data.emoji, user); - - if (reaction) { - this.client.emit(Constants.Events.MESSAGE_REACTION_REMOVE, reaction, user); - } - - return { - message, - reaction, - user, - }; - } -} -/** - * Emitted whenever a reaction is removed from a message. - * @event Client#messageReactionRemove - * @param {MessageReaction} messageReaction The reaction object. - * @param {User} user The user that removed the emoji or reaction emoji. - */ -module.exports = MessageReactionRemove; diff --git a/node_modules/discord.js/src/client/actions/MessageReactionRemoveAll.js b/node_modules/discord.js/src/client/actions/MessageReactionRemoveAll.js deleted file mode 100644 index f35b785..0000000 --- a/node_modules/discord.js/src/client/actions/MessageReactionRemoveAll.js +++ /dev/null @@ -1,25 +0,0 @@ -const Action = require('./Action'); -const Constants = require('../../util/Constants'); - -class MessageReactionRemoveAll extends Action { - handle(data) { - const channel = this.client.channels.get(data.channel_id); - if (!channel || channel.type === 'voice') return false; - - const message = channel.messages.get(data.message_id); - if (!message) return false; - - message._clearReactions(); - this.client.emit(Constants.Events.MESSAGE_REACTION_REMOVE_ALL, message); - - return { - message, - }; - } -} -/** - * Emitted whenever all reactions are removed from a message. - * @event Client#messageReactionRemoveAll - * @param {MessageReaction} messageReaction The reaction object. - */ -module.exports = MessageReactionRemoveAll; diff --git a/node_modules/discord.js/src/client/actions/MessageUpdate.js b/node_modules/discord.js/src/client/actions/MessageUpdate.js deleted file mode 100644 index a62c332..0000000 --- a/node_modules/discord.js/src/client/actions/MessageUpdate.js +++ /dev/null @@ -1,43 +0,0 @@ -const Action = require('./Action'); -const Constants = require('../../util/Constants'); -const cloneObject = require('../../util/CloneObject'); - -class MessageUpdateAction extends Action { - handle(data) { - const client = this.client; - - const channel = client.channels.get(data.channel_id); - if (channel) { - const message = channel.messages.get(data.id); - if (message) { - const oldMessage = cloneObject(message); - message.patch(data); - message._edits.unshift(oldMessage); - client.emit(Constants.Events.MESSAGE_UPDATE, oldMessage, message); - return { - old: oldMessage, - updated: message, - }; - } - - return { - old: message, - updated: message, - }; - } - - return { - old: null, - updated: null, - }; - } -} - -/** - * Emitted whenever a message is updated - e.g. embed or content change. - * @event Client#messageUpdate - * @param {Message} oldMessage The message before the update. - * @param {Message} newMessage The message after the update. - */ - -module.exports = MessageUpdateAction; diff --git a/node_modules/discord.js/src/client/actions/UserGet.js b/node_modules/discord.js/src/client/actions/UserGet.js deleted file mode 100644 index 65e7c95..0000000 --- a/node_modules/discord.js/src/client/actions/UserGet.js +++ /dev/null @@ -1,13 +0,0 @@ -const Action = require('./Action'); - -class UserGetAction extends Action { - handle(data) { - const client = this.client; - const user = client.dataManager.newUser(data); - return { - user, - }; - } -} - -module.exports = UserGetAction; diff --git a/node_modules/discord.js/src/client/actions/UserNoteUpdate.js b/node_modules/discord.js/src/client/actions/UserNoteUpdate.js deleted file mode 100644 index 4c2cc21..0000000 --- a/node_modules/discord.js/src/client/actions/UserNoteUpdate.js +++ /dev/null @@ -1,30 +0,0 @@ -const Action = require('./Action'); -const Constants = require('../../util/Constants'); - -class UserNoteUpdateAction extends Action { - handle(data) { - const client = this.client; - - const oldNote = client.user.notes.get(data.id); - const note = data.note.length ? data.note : null; - - client.user.notes.set(data.id, note); - - client.emit(Constants.Events.USER_NOTE_UPDATE, data.id, oldNote, note); - - return { - old: oldNote, - updated: note, - }; - } -} - -/** - * Emitted whenever a note is updated. - * @event Client#userNoteUpdate - * @param {User} user The user the note belongs to - * @param {string} oldNote The note content before the update - * @param {string} newNote The note content after the update - */ - -module.exports = UserNoteUpdateAction; diff --git a/node_modules/discord.js/src/client/actions/UserUpdate.js b/node_modules/discord.js/src/client/actions/UserUpdate.js deleted file mode 100644 index b361eca..0000000 --- a/node_modules/discord.js/src/client/actions/UserUpdate.js +++ /dev/null @@ -1,33 +0,0 @@ -const Action = require('./Action'); -const Constants = require('../../util/Constants'); -const cloneObject = require('../../util/CloneObject'); - -class UserUpdateAction extends Action { - handle(data) { - const client = this.client; - - if (client.user) { - if (client.user.equals(data)) { - return { - old: client.user, - updated: client.user, - }; - } - - const oldUser = cloneObject(client.user); - client.user.patch(data); - client.emit(Constants.Events.USER_UPDATE, oldUser, client.user); - return { - old: oldUser, - updated: client.user, - }; - } - - return { - old: null, - updated: null, - }; - } -} - -module.exports = UserUpdateAction; -- cgit v1.2.3