Other kinds of reaction removals

This commit is contained in:
Cadence Ember 2023-09-25 23:15:36 +13:00
parent c3040f19c2
commit c1cbdfee82
5 changed files with 151 additions and 42 deletions

View file

@ -214,13 +214,28 @@ module.exports = {
/**
* @param {import("./discord-client")} client
* @param {import("discord-api-types/v10").GatewayMessageReactionAddDispatchData} data
* @param {import("discord-api-types/v10").GatewayMessageReactionRemoveDispatchData} data
*/
async onReactionRemove(client, data) {
if (data.user_id === client.user.id) return // m2d reactions are added by the discord bot user - do not reflect them back to matrix.
await removeReaction.removeReaction(data)
},
/**
* @param {import("./discord-client")} client
* @param {import("discord-api-types/v10").GatewayMessageReactionRemoveEmojiDispatchData} data
*/
async onReactionEmojiRemove(client, data) {
await removeReaction.removeEmojiReaction(data)
},
/**
* @param {import("./discord-client")} client
* @param {import("discord-api-types/v10").GatewayMessageReactionRemoveAllDispatchData} data
*/
async onRemoveAllReactions(client, data) {
await removeReaction.removeAllReactions(data)
},
/**
* @param {import("./discord-client")} client
* @param {import("discord-api-types/v10").GatewayMessageDeleteDispatchData} data