Revert raw event

This commit is contained in:
Daniel Odendahl Jr
2017-12-14 04:42:59 +00:00
parent 0522ac9f31
commit 03af278a4a
2 changed files with 1 additions and 19 deletions
-18
View File
@@ -106,24 +106,6 @@ client.on('messageReactionRemove', async reaction => {
}
});
client.on('raw', async event => {
const data = event.d;
if (event.t === 'MESSAGE_REACTION_ADD') {
const channel = client.channels.get(data.channel_id);
if ((!data.emoji.id && !data.emoji.name) || channel.messages.has(data.message_id)) return;
const user = client.users.get(data.user_id);
const message = await channel.messages.fetch(data.message_id);
const reaction = message.reactions.get(data.emoji.id || data.emoji.name);
client.emit('messageReactionAdd', reaction, user);
} else if (event.t === 'MESSAGE_REACTION_REMOVE') {
const channel = client.channels.get(data.channel_id);
if ((!data.emoji.id && !data.emoji.name) || channel.messages.has(data.message_id)) return;
const message = await channel.messages.fetch(data.message_id);
const reaction = message.reactions.get(data.emoji.id || data.emoji.name);
client.emit('messageReactionRemove', reaction);
}
});
client.login(XIAO_TOKEN);
process.on('unhandledRejection', err => {