mirror of
https://github.com/danbulant/discord.js
synced 2026-07-05 19:20:42 +00:00
Webpack build for branch master: 5b2ca326d4
This commit is contained in:
parent
3c186f15cd
commit
043ed6d5f4
2 changed files with 38 additions and 105 deletions
|
|
@ -22641,9 +22641,7 @@ class ChannelCreateAction extends Action {
|
||||||
handle(data) {
|
handle(data) {
|
||||||
const client = this.client;
|
const client = this.client;
|
||||||
const channel = client.dataManager.newChannel(data);
|
const channel = client.dataManager.newChannel(data);
|
||||||
return {
|
return { channel };
|
||||||
channel,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -22674,9 +22672,7 @@ class ChannelDeleteAction extends Action {
|
||||||
channel = this.deleted.get(data.id) || null;
|
channel = this.deleted.get(data.id) || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return { channel };
|
||||||
channel,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
scheduleForDeletion(id) {
|
scheduleForDeletion(id) {
|
||||||
|
|
@ -22764,9 +22760,7 @@ class GuildChannelsPositionUpdate extends Action {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return { guild };
|
||||||
guild,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -22815,9 +22809,7 @@ class GuildDeleteAction extends Action {
|
||||||
guild = this.deleted.get(data.id) || null;
|
guild = this.deleted.get(data.id) || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return { guild };
|
||||||
guild,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
scheduleForDeletion(id) {
|
scheduleForDeletion(id) {
|
||||||
|
|
@ -22844,9 +22836,7 @@ class GuildEmojiCreateAction extends Action {
|
||||||
handle(guild, createdEmoji) {
|
handle(guild, createdEmoji) {
|
||||||
const client = this.client;
|
const client = this.client;
|
||||||
const emoji = client.dataManager.newEmoji(createdEmoji, guild);
|
const emoji = client.dataManager.newEmoji(createdEmoji, guild);
|
||||||
return {
|
return { emoji };
|
||||||
emoji,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -22869,9 +22859,7 @@ class GuildEmojiDeleteAction extends Action {
|
||||||
handle(emoji) {
|
handle(emoji) {
|
||||||
const client = this.client;
|
const client = this.client;
|
||||||
client.dataManager.killEmoji(emoji);
|
client.dataManager.killEmoji(emoji);
|
||||||
return {
|
return { emoji };
|
||||||
emoji,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -22893,9 +22881,7 @@ const Action = __webpack_require__(2);
|
||||||
class GuildEmojiUpdateAction extends Action {
|
class GuildEmojiUpdateAction extends Action {
|
||||||
handle(oldEmoji, newEmoji) {
|
handle(oldEmoji, newEmoji) {
|
||||||
const emoji = this.client.dataManager.updateEmoji(oldEmoji, newEmoji);
|
const emoji = this.client.dataManager.updateEmoji(oldEmoji, newEmoji);
|
||||||
return {
|
return { emoji };
|
||||||
emoji,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -22962,9 +22948,7 @@ const Action = __webpack_require__(2);
|
||||||
class GuildMemberGetAction extends Action {
|
class GuildMemberGetAction extends Action {
|
||||||
handle(guild, data) {
|
handle(guild, data) {
|
||||||
const member = guild._addMember(data, false);
|
const member = guild._addMember(data, false);
|
||||||
return {
|
return { member };
|
||||||
member,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -22986,10 +22970,10 @@ class GuildMemberRemoveAction extends Action {
|
||||||
|
|
||||||
handle(data) {
|
handle(data) {
|
||||||
const client = this.client;
|
const client = this.client;
|
||||||
|
|
||||||
const guild = client.guilds.get(data.guild_id);
|
const guild = client.guilds.get(data.guild_id);
|
||||||
|
let member = null;
|
||||||
if (guild) {
|
if (guild) {
|
||||||
let member = guild.members.get(data.user.id);
|
member = guild.members.get(data.user.id);
|
||||||
if (member) {
|
if (member) {
|
||||||
guild.memberCount--;
|
guild.memberCount--;
|
||||||
guild._removeMember(member);
|
guild._removeMember(member);
|
||||||
|
|
@ -22999,17 +22983,8 @@ class GuildMemberRemoveAction extends Action {
|
||||||
} else {
|
} else {
|
||||||
member = this.deleted.get(guild.id + data.user.id) || null;
|
member = this.deleted.get(guild.id + data.user.id) || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
|
||||||
guild,
|
|
||||||
member,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
return { guild, member };
|
||||||
return {
|
|
||||||
guild,
|
|
||||||
member: null,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
scheduleForDeletion(guildID, userID) {
|
scheduleForDeletion(guildID, userID) {
|
||||||
|
|
@ -23037,22 +23012,15 @@ const Role = __webpack_require__(15);
|
||||||
class GuildRoleCreate extends Action {
|
class GuildRoleCreate extends Action {
|
||||||
handle(data) {
|
handle(data) {
|
||||||
const client = this.client;
|
const client = this.client;
|
||||||
|
|
||||||
const guild = client.guilds.get(data.guild_id);
|
const guild = client.guilds.get(data.guild_id);
|
||||||
|
let role;
|
||||||
if (guild) {
|
if (guild) {
|
||||||
const already = guild.roles.has(data.role.id);
|
const already = guild.roles.has(data.role.id);
|
||||||
const role = new Role(guild, data.role);
|
role = new Role(guild, data.role);
|
||||||
guild.roles.set(role.id, role);
|
guild.roles.set(role.id, role);
|
||||||
if (!already) client.emit(Constants.Events.GUILD_ROLE_CREATE, role);
|
if (!already) client.emit(Constants.Events.GUILD_ROLE_CREATE, role);
|
||||||
|
|
||||||
return {
|
|
||||||
role,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
return { role };
|
||||||
return {
|
|
||||||
role: null,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -23080,10 +23048,11 @@ class GuildRoleDeleteAction extends Action {
|
||||||
|
|
||||||
handle(data) {
|
handle(data) {
|
||||||
const client = this.client;
|
const client = this.client;
|
||||||
|
|
||||||
const guild = client.guilds.get(data.guild_id);
|
const guild = client.guilds.get(data.guild_id);
|
||||||
|
let role;
|
||||||
|
|
||||||
if (guild) {
|
if (guild) {
|
||||||
let role = guild.roles.get(data.role_id);
|
role = guild.roles.get(data.role_id);
|
||||||
if (role) {
|
if (role) {
|
||||||
guild.roles.delete(data.role_id);
|
guild.roles.delete(data.role_id);
|
||||||
this.deleted.set(guild.id + data.role_id, role);
|
this.deleted.set(guild.id + data.role_id, role);
|
||||||
|
|
@ -23092,15 +23061,9 @@ class GuildRoleDeleteAction extends Action {
|
||||||
} else {
|
} else {
|
||||||
role = this.deleted.get(guild.id + data.role_id) || null;
|
role = this.deleted.get(guild.id + data.role_id) || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
|
||||||
role,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return { role };
|
||||||
role: null,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
scheduleForDeletion(guildID, roleID) {
|
scheduleForDeletion(guildID, roleID) {
|
||||||
|
|
@ -23128,8 +23091,8 @@ const Util = __webpack_require__(4);
|
||||||
class GuildRoleUpdateAction extends Action {
|
class GuildRoleUpdateAction extends Action {
|
||||||
handle(data) {
|
handle(data) {
|
||||||
const client = this.client;
|
const client = this.client;
|
||||||
|
|
||||||
const guild = client.guilds.get(data.guild_id);
|
const guild = client.guilds.get(data.guild_id);
|
||||||
|
|
||||||
if (guild) {
|
if (guild) {
|
||||||
const roleData = data.role;
|
const roleData = data.role;
|
||||||
let oldRole = null;
|
let oldRole = null;
|
||||||
|
|
@ -23182,9 +23145,7 @@ class GuildRolesPositionUpdate extends Action {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return { guild };
|
||||||
guild,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -23341,11 +23302,11 @@ class MessageDeleteAction extends Action {
|
||||||
|
|
||||||
handle(data) {
|
handle(data) {
|
||||||
const client = this.client;
|
const client = this.client;
|
||||||
|
|
||||||
const channel = client.channels.get(data.channel_id);
|
const channel = client.channels.get(data.channel_id);
|
||||||
if (channel) {
|
let message;
|
||||||
let message = channel.messages.get(data.id);
|
|
||||||
|
|
||||||
|
if (channel) {
|
||||||
|
message = channel.messages.get(data.id);
|
||||||
if (message) {
|
if (message) {
|
||||||
channel.messages.delete(message.id);
|
channel.messages.delete(message.id);
|
||||||
this.deleted.set(channel.id + message.id, message);
|
this.deleted.set(channel.id + message.id, message);
|
||||||
|
|
@ -23353,15 +23314,9 @@ class MessageDeleteAction extends Action {
|
||||||
} else {
|
} else {
|
||||||
message = this.deleted.get(channel.id + data.id) || null;
|
message = this.deleted.get(channel.id + data.id) || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
|
||||||
message,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return { message };
|
||||||
message: null,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
scheduleForDeletion(channelID, messageID) {
|
scheduleForDeletion(channelID, messageID) {
|
||||||
|
|
@ -23394,9 +23349,7 @@ class MessageDeleteBulkAction extends Action {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (messages.size > 0) client.emit(Constants.Events.MESSAGE_BULK_DELETE, messages);
|
if (messages.size > 0) client.emit(Constants.Events.MESSAGE_BULK_DELETE, messages);
|
||||||
return {
|
return { messages };
|
||||||
messages,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -23421,26 +23374,18 @@ class MessageReactionAdd extends Action {
|
||||||
handle(data) {
|
handle(data) {
|
||||||
const user = this.client.users.get(data.user_id);
|
const user = this.client.users.get(data.user_id);
|
||||||
if (!user) return false;
|
if (!user) return false;
|
||||||
|
// Verify channel
|
||||||
const channel = this.client.channels.get(data.channel_id);
|
const channel = this.client.channels.get(data.channel_id);
|
||||||
if (!channel || channel.type === 'voice') return false;
|
if (!channel || channel.type === 'voice') return false;
|
||||||
|
// Verify message
|
||||||
const message = channel.messages.get(data.message_id);
|
const message = channel.messages.get(data.message_id);
|
||||||
if (!message) return false;
|
if (!message) return false;
|
||||||
|
|
||||||
if (!data.emoji) return false;
|
if (!data.emoji) return false;
|
||||||
|
// Verify reaction
|
||||||
const reaction = message._addReaction(data.emoji, user);
|
const reaction = message._addReaction(data.emoji, user);
|
||||||
|
if (reaction) this.client.emit(Constants.Events.MESSAGE_REACTION_ADD, reaction, user);
|
||||||
|
|
||||||
if (reaction) {
|
return { message, reaction, user };
|
||||||
this.client.emit(Constants.Events.MESSAGE_REACTION_ADD, reaction, user);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
message,
|
|
||||||
reaction,
|
|
||||||
user,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -23472,26 +23417,18 @@ class MessageReactionRemove extends Action {
|
||||||
handle(data) {
|
handle(data) {
|
||||||
const user = this.client.users.get(data.user_id);
|
const user = this.client.users.get(data.user_id);
|
||||||
if (!user) return false;
|
if (!user) return false;
|
||||||
|
// Verify channel
|
||||||
const channel = this.client.channels.get(data.channel_id);
|
const channel = this.client.channels.get(data.channel_id);
|
||||||
if (!channel || channel.type === 'voice') return false;
|
if (!channel || channel.type === 'voice') return false;
|
||||||
|
// Verify message
|
||||||
const message = channel.messages.get(data.message_id);
|
const message = channel.messages.get(data.message_id);
|
||||||
if (!message) return false;
|
if (!message) return false;
|
||||||
|
|
||||||
if (!data.emoji) return false;
|
if (!data.emoji) return false;
|
||||||
|
// Verify reaction
|
||||||
const reaction = message._removeReaction(data.emoji, user);
|
const reaction = message._removeReaction(data.emoji, user);
|
||||||
|
if (reaction) this.client.emit(Constants.Events.MESSAGE_REACTION_REMOVE, reaction, user);
|
||||||
|
|
||||||
if (reaction) {
|
return { message, reaction, user };
|
||||||
this.client.emit(Constants.Events.MESSAGE_REACTION_REMOVE, reaction, user);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
message,
|
|
||||||
reaction,
|
|
||||||
user,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -23523,9 +23460,7 @@ class MessageReactionRemoveAll extends Action {
|
||||||
message._clearReactions();
|
message._clearReactions();
|
||||||
this.client.emit(Constants.Events.MESSAGE_REACTION_REMOVE_ALL, message);
|
this.client.emit(Constants.Events.MESSAGE_REACTION_REMOVE_ALL, message);
|
||||||
|
|
||||||
return {
|
return { message };
|
||||||
message,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -23594,9 +23529,7 @@ class UserGetAction extends Action {
|
||||||
handle(data) {
|
handle(data) {
|
||||||
const client = this.client;
|
const client = this.client;
|
||||||
const user = client.dataManager.newUser(data);
|
const user = client.dataManager.newUser(data);
|
||||||
return {
|
return { user };
|
||||||
user,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
2
discord.master.min.js
vendored
2
discord.master.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue