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
this.reactionRemoveQueue.add(async () => { setTimeout(() => {
await msg.channel.removeMessageReaction(msg.id, reaction, userId).catch(noop); this.reactionRemoveQueue.add(async () => {
await sleep(250); const reaction = emoji.id ? `${emoji.name}:${emoji.id}` : emoji.name;
}); await msg.channel.removeMessageReaction(msg.id, reaction, userId).catch(noop);
await sleep(250);
});
}, 2000);
} }
} }