3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Merge pull request #210 from almeidx/fix/selfgrantableroles-mentions

Made RoleAddCmd and RoleRemoveCmd mention the command author
This commit is contained in:
Miikka 2021-08-14 17:14:10 +03:00 committed by GitHub
commit a9ad733826
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -43,6 +43,7 @@ export const RoleAddCmd = selfGrantableRolesCmd({
pluginData,
msg.channel,
`<@!${msg.author.id}> Unknown ${args.roleNames.length === 1 ? "role" : "roles"}`,
{ users: [msg.author.id] },
);
lock.unlock();
return;
@ -87,6 +88,7 @@ export const RoleAddCmd = selfGrantableRolesCmd({
pluginData,
msg.channel,
`<@!${msg.author.id}> Got an error while trying to grant you the roles`,
{ users: [msg.author.id] },
);
return;
}
@ -118,7 +120,9 @@ export const RoleAddCmd = selfGrantableRolesCmd({
messageParts.push("couldn't recognize some of the roles");
}
sendSuccessMessage(pluginData, msg.channel, `<@!${msg.author.id}> ${messageParts.join("; ")}`);
sendSuccessMessage(pluginData, msg.channel, `<@!${msg.author.id}> ${messageParts.join("; ")}`, {
users: [msg.author.id],
});
lock.unlock();
},

View file

@ -51,12 +51,14 @@ export const RoleRemoveCmd = selfGrantableRolesCmd({
msg.channel,
`<@!${msg.author.id}> Removed ${removedRolesStr.join(", ")} ${removedRolesWord};` +
` couldn't recognize the other roles you mentioned`,
{ users: [msg.author.id] },
);
} else {
sendSuccessMessage(
pluginData,
msg.channel,
`<@!${msg.author.id}> Removed ${removedRolesStr.join(", ")} ${removedRolesWord}`,
{ users: [msg.author.id] },
);
}
} catch {
@ -64,6 +66,7 @@ export const RoleRemoveCmd = selfGrantableRolesCmd({
pluginData,
msg.channel,
`<@!${msg.author.id}> Got an error while trying to remove the roles`,
{ users: [msg.author.id] },
);
}
} else {
@ -71,6 +74,7 @@ export const RoleRemoveCmd = selfGrantableRolesCmd({
pluginData,
msg.channel,
`<@!${msg.author.id}> Unknown ${args.roleNames.length === 1 ? "role" : "roles"}`,
{ users: [msg.author.id] },
);
}