diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-14 21:49:36 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-14 21:49:36 -0400 |
commit | 462c47184573527e048c29cb332b2d2a04626f61 (patch) | |
tree | 97d8cc86019a494f7bf1a2e39ae413f81965a904 /src | |
parent | e0c0bb2eeb470a926782588c4d082ea9a3bfd669 (diff) | |
download | tanzanite-462c47184573527e048c29cb332b2d2a04626f61.tar.gz tanzanite-462c47184573527e048c29cb332b2d2a04626f61.tar.bz2 tanzanite-462c47184573527e048c29cb332b2d2a04626f61.zip |
maybe fix errors?
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/extensions/discord.js/BushGuildMember.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/extensions/discord.js/BushGuildMember.ts b/src/lib/extensions/discord.js/BushGuildMember.ts index 1606ad6..a877ea6 100644 --- a/src/lib/extensions/discord.js/BushGuildMember.ts +++ b/src/lib/extensions/discord.js/BushGuildMember.ts @@ -81,7 +81,7 @@ export class BushGuildMember extends GuildMember { } public async warn(options: BushPunishmentOptions): Promise<{ result: WarnResponse; caseNum: number }> { - const moderator = client.users.cache.get(client.users.resolveId(options.moderator || client.user)); + const moderator = client.users.cache.get(client.users.resolveId(options.moderator)) ?? client.user; // add modlog entry const result = await util.createModLogEntry( { @@ -112,7 +112,7 @@ export class BushGuildMember extends GuildMember { const ifShouldAddRole = this.#checkIfShouldAddRole(options.role); if (ifShouldAddRole !== true) return ifShouldAddRole; - const moderator = client.users.cache.get(client.users.resolveId(options.moderator || client.user)); + const moderator = client.users.cache.get(client.users.resolveId(options.moderator)) ?? client.user; if (options.addToModlog) { const { log: modlog } = await util.createModLogEntry({ @@ -147,7 +147,7 @@ export class BushGuildMember extends GuildMember { const ifShouldAddRole = this.#checkIfShouldAddRole(options.role); if (ifShouldAddRole !== true) return ifShouldAddRole; - const moderator = client.users.cache.get(client.users.resolveId(options.moderator || client.user)); + const moderator = client.users.cache.get(client.users.resolveId(options.moderator)) ?? client.user; if (options.addToModlog) { const { log: modlog } = await util.createModLogEntry({ @@ -195,7 +195,7 @@ export class BushGuildMember extends GuildMember { if (!muteRole) return 'invalid mute role'; if (muteRole.position >= this.guild.me.roles.highest.position || muteRole.managed) return 'mute role not manageable'; - const moderator = client.users.cache.get(client.users.resolveId(options.moderator || client.user)); + const moderator = client.users.cache.get(client.users.resolveId(options.moderator)) ?? client.user; // add role const muteSuccess = await this.roles @@ -248,7 +248,7 @@ export class BushGuildMember extends GuildMember { if (!muteRole) return 'invalid mute role'; if (muteRole.position >= this.guild.me.roles.highest.position || muteRole.managed) return 'mute role not manageable'; - const moderator = client.users.cache.get(client.users.resolveId(options.moderator || client.user)); + const moderator = client.users.cache.get(client.users.resolveId(options.moderator)) ?? client.user; //remove role const muteSuccess = await this.roles @@ -290,7 +290,7 @@ export class BushGuildMember extends GuildMember { // checks if (!this.guild.me.permissions.has('KICK_MEMBERS') || !this.kickable) return 'missing permissions'; - const moderator = client.users.cache.get(client.users.resolveId(options.moderator || client.user)); + const moderator = client.users.cache.get(client.users.resolveId(options.moderator)) ?? client.user; // dm user const ending = await this.guild.getSetting('punishmentEnding'); @@ -323,7 +323,7 @@ export class BushGuildMember extends GuildMember { // checks if (!this.guild.me.permissions.has('BAN_MEMBERS') || !this.bannable) return 'missing permissions'; - const moderator = client.users.cache.get(client.users.resolveId(options.moderator || client.user)); + const moderator = client.users.cache.get(client.users.resolveId(options.moderator)) ?? client.user; // dm user const ending = await this.guild.getSetting('punishmentEnding'); |