diff options
Diffstat (limited to 'src/lib/common')
-rw-r--r-- | src/lib/common/AutoMod.ts | 18 | ||||
-rw-r--r-- | src/lib/common/ButtonPaginator.ts | 4 | ||||
-rw-r--r-- | src/lib/common/ConfirmationPrompt.ts | 4 | ||||
-rw-r--r-- | src/lib/common/DeleteButton.ts | 4 | ||||
-rw-r--r-- | src/lib/common/util/Moderation.ts | 2 |
5 files changed, 16 insertions, 16 deletions
diff --git a/src/lib/common/AutoMod.ts b/src/lib/common/AutoMod.ts index 5534728..b08fc40 100644 --- a/src/lib/common/AutoMod.ts +++ b/src/lib/common/AutoMod.ts @@ -166,18 +166,18 @@ export class AutoMod { .setDescription( `**User:** ${this.message.author} (${this.message.author.tag})\n**Sent From:** <#${this.message.channel.id}> [Jump to context](${this.message.url})` ) - .addFields({ name: 'Message Content', value: `${await util.codeblock(this.message.content, 1024)}` }) + .addFields([{ name: 'Message Content', value: `${await util.codeblock(this.message.content, 1024)}` }]) .setColor(color) .setTimestamp() ], components: [ - new ActionRowBuilder<ButtonBuilder>().addComponents( + new ActionRowBuilder<ButtonBuilder>().addComponents([ new ButtonBuilder({ style: ButtonStyle.Danger, label: 'Ban User', customId: `automod;ban;${this.message.author.id};everyone mention and scam phrase` }) - ) + ]) ] }); } @@ -259,7 +259,7 @@ export class AutoMod { color = util.colors.yellow; void this.message.delete().catch((e) => deleteError.bind(this, e)); void this.message.member?.bushWarn({ - moderator: this.message.guild!.me!, + moderator: this.message.guild!.members.me!, reason: `[AutoMod] ${highestOffence.reason}` }); this.punished = true; @@ -269,7 +269,7 @@ export class AutoMod { color = util.colors.orange; void this.message.delete().catch((e) => deleteError.bind(this, e)); void this.message.member?.bushMute({ - moderator: this.message.guild!.me!, + moderator: this.message.guild!.members.me!, reason: `[AutoMod] ${highestOffence.reason}`, duration: 900_000 // 15 minutes }); @@ -280,7 +280,7 @@ export class AutoMod { color = util.colors.red; void this.message.delete().catch((e) => deleteError.bind(this, e)); void this.message.member?.bushMute({ - moderator: this.message.guild!.me!, + moderator: this.message.guild!.members.me!, reason: `[AutoMod] ${highestOffence.reason}`, duration: 0 // permanent }); @@ -331,7 +331,7 @@ export class AutoMod { this.message.channel.id }> [Jump to context](${this.message.url})\n**Blacklisted Words:** ${offences.map((o) => `\`${o.match}\``).join(', ')}` ) - .addFields({ name: 'Message Content', value: `${await util.codeblock(this.message.content, 1024)}` }) + .addFields([{ name: 'Message Content', value: `${await util.codeblock(this.message.content, 1024)}` }]) .setColor(color) .setTimestamp() .setAuthor({ name: this.message.author.tag, url: this.message.author.displayAvatarURL() }) @@ -339,13 +339,13 @@ export class AutoMod { components: highestOffence.severity >= 2 ? [ - new ActionRowBuilder<ButtonBuilder>().addComponents( + new ActionRowBuilder<ButtonBuilder>().addComponents([ new ButtonBuilder({ style: ButtonStyle.Danger, label: 'Ban User', customId: `automod;ban;${this.message.author.id};${highestOffence.reason}` }) - ) + ]) ] : undefined }); diff --git a/src/lib/common/ButtonPaginator.ts b/src/lib/common/ButtonPaginator.ts index 59dcb68..cc95601 100644 --- a/src/lib/common/ButtonPaginator.ts +++ b/src/lib/common/ButtonPaginator.ts @@ -171,7 +171,7 @@ export class ButtonPaginator { * @returns The generated {@link ActionRow} */ protected getPaginationRow(disableAll = false) { - return new ActionRowBuilder<ButtonBuilder>().addComponents( + return new ActionRowBuilder<ButtonBuilder>().addComponents([ new ButtonBuilder({ style: ButtonStyle.Primary, customId: 'paginate_beginning', @@ -202,7 +202,7 @@ export class ButtonPaginator { emoji: PaginateEmojis.END, disabled: disableAll || this.curPage === this.numPages - 1 }) - ); + ]); } /** diff --git a/src/lib/common/ConfirmationPrompt.ts b/src/lib/common/ConfirmationPrompt.ts index e86c236..c611fd3 100644 --- a/src/lib/common/ConfirmationPrompt.ts +++ b/src/lib/common/ConfirmationPrompt.ts @@ -29,10 +29,10 @@ export class ConfirmationPrompt { */ protected async send(): Promise<boolean> { this.messageOptions.components = [ - new ActionRowBuilder<ButtonBuilder>().addComponents( + new ActionRowBuilder<ButtonBuilder>().addComponents([ new ButtonBuilder({ style: ButtonStyle.Success, customId: 'confirmationPrompt_confirm', label: 'Yes' }), new ButtonBuilder({ style: ButtonStyle.Danger, customId: 'confirmationPrompt_cancel', label: 'No' }) - ) + ]) ]; const msg = await this.message.channel!.send(this.messageOptions); diff --git a/src/lib/common/DeleteButton.ts b/src/lib/common/DeleteButton.ts index 4874f78..03e2639 100644 --- a/src/lib/common/DeleteButton.ts +++ b/src/lib/common/DeleteButton.ts @@ -66,14 +66,14 @@ export class DeleteButton { */ protected updateComponents(edit = false, disable = false): void { this.messageOptions.components = [ - new ActionRowBuilder<ButtonBuilder>().addComponents( + new ActionRowBuilder<ButtonBuilder>().addComponents([ new ButtonBuilder({ style: ButtonStyle.Primary, customId: 'paginate__stop', emoji: PaginateEmojis.STOP, disabled: disable }) - ) + ]) ]; if (edit) { this.messageOptions.reply = undefined; diff --git a/src/lib/common/util/Moderation.ts b/src/lib/common/util/Moderation.ts index f388121..9f93375 100644 --- a/src/lib/common/util/Moderation.ts +++ b/src/lib/common/util/Moderation.ts @@ -91,7 +91,7 @@ export class Moderation { return `${util.emojis.error} You cannot ${type} **${victim.user.tag}** because they have higher or equal role hierarchy as you do.`; } if ( - victim.roles.highest.position >= victim.guild.me!.roles.highest.position && + victim.roles.highest.position >= victim.guild.members.me!.roles.highest.position && !(type.startsWith('un') && moderator.id === victim.id) ) { return `${util.emojis.error} You cannot ${type} **${victim.user.tag}** because they have higher or equal role hierarchy as I do.`; |