Refactor reaction removals and add tests

This commit is contained in:
Cadence Ember 2023-10-10 14:03:53 +13:00
commit bf0691f9bb
6 changed files with 318 additions and 102 deletions

View file

@ -155,14 +155,8 @@ const utils = {
} else if (message.t === "MESSAGE_REACTION_ADD") {
await eventDispatcher.onReactionAdd(client, message.d)
} else if (message.t === "MESSAGE_REACTION_REMOVE") {
await eventDispatcher.onReactionRemove(client, message.d)
} else if (message.t === "MESSAGE_REACTION_REMOVE_EMOJI") {
await eventDispatcher.onReactionEmojiRemove(client, message.d)
} else if (message.t === "MESSAGE_REACTION_REMOVE_ALL") {
await eventDispatcher.onRemoveAllReactions(client, message.d)
} else if (message.t === "MESSAGE_REACTION_REMOVE" || message.t === "MESSAGE_REACTION_REMOVE_EMOJI" || message.t === "MESSAGE_REACTION_REMOVE_ALL") {
await eventDispatcher.onSomeReactionsRemoved(client, message.d)
}
} catch (e) {
// Let OOYE try to handle errors too