diff options
Diffstat (limited to 'src/lib/extensions/discord.js')
-rw-r--r-- | src/lib/extensions/discord.js/BushGuild.ts | 6 | ||||
-rw-r--r-- | src/lib/extensions/discord.js/BushGuildMember.ts | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/extensions/discord.js/BushGuild.ts b/src/lib/extensions/discord.js/BushGuild.ts index 4fc27a7..2c3b4bd 100644 --- a/src/lib/extensions/discord.js/BushGuild.ts +++ b/src/lib/extensions/discord.js/BushGuild.ts @@ -73,8 +73,7 @@ export class BushGuild extends Guild { if (!bans.has(user)) notBanned = true; const unbanSuccess = await this.bans - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - .remove(user, `${moderator.tag} | ${options.reason || 'No reason provided.'}`) + .remove(user, `${moderator.tag} | ${options.reason ?? 'No reason provided.'}`) .catch((e) => { if (e?.code === 'UNKNOWN_BAN') { notBanned = true; @@ -108,8 +107,7 @@ export class BushGuild extends Guild { const userObject = client.users.cache.get(user); - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - userObject?.send(`You have been unbanned from **${this}** for **${options.reason || 'No reason provided'}**.`); + userObject?.send(`You have been unbanned from **${this}** for **${options.reason ?? 'No reason provided'}**.`); if (notBanned) return 'user not banned'; return 'success'; diff --git a/src/lib/extensions/discord.js/BushGuildMember.ts b/src/lib/extensions/discord.js/BushGuildMember.ts index e596c82..6ce473a 100644 --- a/src/lib/extensions/discord.js/BushGuildMember.ts +++ b/src/lib/extensions/discord.js/BushGuildMember.ts @@ -182,7 +182,7 @@ export class BushGuildMember extends GuildMember { } #checkIfShouldAddRole(role: BushRole | Role): true | 'user hierarchy' | 'role managed' | 'client hierarchy' { - if (this.roles.highest.position <= role.position) { + if (this.roles.highest.position <= role.position && this.guild.ownerId !== this.id) { return 'user hierarchy'; } else if (role.managed) { return 'role managed'; |