3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 20:35:02 +00:00

ReactionRoles: add a small delay before removing the reaction

This commit is contained in:
Dragory 2019-02-16 14:40:44 +02:00
parent 6358022442
commit d694d9f129

View file

@ -209,10 +209,13 @@ export class ReactionRolesPlugin extends ZeppelinPlugin {
}); });
} }
const reaction = emoji.id ? `${emoji.name}:${emoji.id}` : emoji.name; // Remove the reaction after a small delay
setTimeout(() => {
this.reactionRemoveQueue.add(async () => { this.reactionRemoveQueue.add(async () => {
const reaction = emoji.id ? `${emoji.name}:${emoji.id}` : emoji.name;
await msg.channel.removeMessageReaction(msg.id, reaction, userId).catch(noop); await msg.channel.removeMessageReaction(msg.id, reaction, userId).catch(noop);
await sleep(250); await sleep(250);
}); });
}, 2000);
} }
} }