Better errors for reaction roles
This commit is contained in:
parent
fca8a8dcce
commit
b53acd6b84
2 changed files with 57 additions and 17 deletions
|
@ -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);
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue