3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-11 13:07:20 +00:00

Better errors for reaction roles

This commit is contained in:
Dragory 2020-08-28 01:30:25 +03:00
parent cee3afbef8
commit b9f0949508
2 changed files with 57 additions and 17 deletions

View file

@ -102,9 +102,19 @@ export const InitReactionRolesCmd = reactionRolesCmd({
// Apply the reactions themselves
const reactionRoles = await pluginData.state.reactionRoles.getForMessage(targetMessage.id);
await applyReactionRoleReactionsToMessage(pluginData, targetMessage.channel.id, targetMessage.id, reactionRoles);
const errors = await applyReactionRoleReactionsToMessage(
pluginData,
targetMessage.channel.id,
targetMessage.id,
reactionRoles,
);
if (errors.length) {
sendErrorMessage(pluginData, msg.channel, `Errors while adding reaction roles:\n${errors.join("\n")}`);
} else {
sendSuccessMessage(pluginData, msg.channel, "Reaction roles added");
}
sendSuccessMessage(pluginData, msg.channel, "Reaction roles added");
(await progressMessage).delete().catch(noop);
},
});