mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-08 03:27:20 +00:00
Fixes, refactoring and PR feedback
This commit is contained in:
parent
0be54912c4
commit
893a77d562
202 changed files with 1037 additions and 1069 deletions
|
@ -29,22 +29,20 @@ export const MassRemoveRoleCmd = rolesCmd({
|
|||
|
||||
for (const member of members) {
|
||||
if (!canActOn(pluginData, msg.member, member, true)) {
|
||||
pluginData
|
||||
.getPlugin(CommonPlugin)
|
||||
.sendErrorMessage(msg, "Cannot add roles to 1 or more specified members: insufficient permissions");
|
||||
void pluginData.state.common.sendErrorMessage(msg, "Cannot add roles to 1 or more specified members: insufficient permissions");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const roleId = await resolveRoleId(pluginData.client, pluginData.guild.id, args.role);
|
||||
if (!roleId) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "Invalid role id");
|
||||
void pluginData.state.common.sendErrorMessage(msg, "Invalid role id");
|
||||
return;
|
||||
}
|
||||
|
||||
const config = await pluginData.config.getForMessage(msg);
|
||||
if (!config.assignable_roles.includes(roleId)) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "You cannot remove that role");
|
||||
void pluginData.state.common.sendErrorMessage(msg, "You cannot remove that role");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -53,7 +51,7 @@ export const MassRemoveRoleCmd = rolesCmd({
|
|||
pluginData.getPlugin(LogsPlugin).logBotAlert({
|
||||
body: `Unknown role configured for 'roles' plugin: ${roleId}`,
|
||||
});
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "You cannot remove that role");
|
||||
void pluginData.state.common.sendErrorMessage(msg, "You cannot remove that role");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue