3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 08:45:03 +00:00

reaction_roles: add remove_user_reactions option

This commit is contained in:
Dragory 2020-08-30 00:49:44 +03:00
parent ba9c5db9ef
commit 9dc5b45f52
3 changed files with 13 additions and 8 deletions

View file

@ -51,13 +51,16 @@ export const AddReactionRoleEvt = reactionRolesEvent({
}
// Remove the reaction after a small delay
setTimeout(() => {
pluginData.state.reactionRemoveQueue.add(async () => {
const reaction = emoji.id ? `${emoji.name}:${emoji.id}` : emoji.name;
const wait = sleep(1500);
await msg.channel.removeMessageReaction(msg.id, reaction, userId).catch(noop);
await wait;
});
}, 1500);
const config = pluginData.config.getForMember(member);
if (config.remove_user_reactions) {
setTimeout(() => {
pluginData.state.reactionRemoveQueue.add(async () => {
const reaction = emoji.id ? `${emoji.name}:${emoji.id}` : emoji.name;
const wait = sleep(1500);
await msg.channel.removeMessageReaction(msg.id, reaction, userId).catch(noop);
await wait;
});
}, 1500);
}
},
});