aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/role.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-13 15:04:42 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-13 15:04:42 -0400
commitcdb8b0297f806cb3147b3759b0fd234bffbcc3f9 (patch)
tree665c8d746e1ec7dee5755edbc7a8e6be7f77c26d /src/commands/moderation/role.ts
parent528a4c2bde37ca7d1ded38af31f4a482d492d894 (diff)
downloadtanzanite-cdb8b0297f806cb3147b3759b0fd234bffbcc3f9.tar.gz
tanzanite-cdb8b0297f806cb3147b3759b0fd234bffbcc3f9.tar.bz2
tanzanite-cdb8b0297f806cb3147b3759b0fd234bffbcc3f9.zip
added unmute and unban command
Diffstat (limited to 'src/commands/moderation/role.ts')
-rw-r--r--src/commands/moderation/role.ts12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/commands/moderation/role.ts b/src/commands/moderation/role.ts
index 33f474e..29913d5 100644
--- a/src/commands/moderation/role.ts
+++ b/src/commands/moderation/role.ts
@@ -4,7 +4,7 @@ import { AllowedMentions, BushCommand, BushGuildMember, BushMessage, BushRole, B
export default class RoleCommand extends BushCommand {
public constructor() {
super('role', {
- aliases: ['role', 'addrole', 'removerole'],
+ aliases: ['role'],
category: 'moderation',
description: {
content: "Manages users' roles.",
@@ -69,7 +69,6 @@ export default class RoleCommand extends BushCommand {
start: `What user do you want to ${action} the role ${action2}?`,
retry: `{error} Choose a valid user to ${action} the role ${action2}.`
}
- //unordered: true
};
const role = yield {
id: 'role',
@@ -87,7 +86,7 @@ export default class RoleCommand extends BushCommand {
message: BushMessage | BushSlashMessage,
{ action, user, role }: { action: 'add' | 'remove'; user: BushGuildMember; role: BushRole }
): Promise<unknown> {
- if (!message.member.permissions.has('MANAGE_ROLES') && !this.client.ownerID.includes(message.author.id)) {
+ if (!message.member.permissions.has('MANAGE_ROLES') && !message.author.isOwner()) {
const mappings = this.client.consts.mappings;
let mappedRole: { name: string; id: string };
for (let i = 0; i < mappings.roleMap.length; i++) {
@@ -112,8 +111,7 @@ export default class RoleCommand extends BushCommand {
allowedMentions: AllowedMentions.none()
});
}
- }
- if (!this.client.ownerID.includes(message.author.id)) {
+ } else if (!message.author.isOwner()) {
if (role.comparePositionTo(message.member.roles.highest) >= 0) {
return await message.util.reply({
content: `${this.client.util.emojis.error} <@&${role.id}> is higher or equal to your highest role.`,
@@ -127,7 +125,7 @@ export default class RoleCommand extends BushCommand {
});
}
if (role.managed) {
- await await message.util.reply({
+ return await message.util.reply({
content: `${this.client.util.emojis.error} <@&${role.id}> is managed by an integration and cannot be managed.`,
allowedMentions: AllowedMentions.none()
});
@@ -138,7 +136,7 @@ export default class RoleCommand extends BushCommand {
const success = await user.roles.remove(role.id).catch(() => {});
if (success) {
return await message.util.reply({
- content: `${this.client.util.emojis.success}Successfully removed <@&${role.id}> from <@${user.id}>!`,
+ content: `${this.client.util.emojis.success} Successfully removed <@&${role.id}> from <@${user.id}>!`,
allowedMentions: AllowedMentions.none()
});
} else {