diff options
Diffstat (limited to 'src/lib/common')
-rw-r--r-- | src/lib/common/ButtonPaginator.ts | 26 | ||||
-rw-r--r-- | src/lib/common/DeleteButton.ts | 2 | ||||
-rw-r--r-- | src/lib/common/Moderation.ts | 16 | ||||
-rw-r--r-- | src/lib/common/typings/BushInspectOptions.d.ts | 4 |
4 files changed, 25 insertions, 23 deletions
diff --git a/src/lib/common/ButtonPaginator.ts b/src/lib/common/ButtonPaginator.ts index 6a2dba2..b8ae249 100644 --- a/src/lib/common/ButtonPaginator.ts +++ b/src/lib/common/ButtonPaginator.ts @@ -1,11 +1,11 @@ import { DeleteButton, type BushMessage, type BushSlashMessage } from '#lib'; import { - Constants, - MessageActionRow, - MessageButton, - MessageEmbed, - type MessageComponentInteraction, - type MessageEmbedOptions + Constants, + MessageActionRow, + MessageButton, + MessageEmbed, + type MessageComponentInteraction, + type MessageEmbedOptions } from 'discord.js'; export class ButtonPaginator { @@ -75,7 +75,7 @@ export class ButtonPaginator { })) as BushMessage; const collector = this.sentMessage.createMessageComponentCollector({ - filter: (i) => i.customId.startsWith('paginate_') && i.message.id === this.sentMessage!.id, + filter: (i) => i.customId.startsWith('paginate_') && i.message?.id === this.sentMessage!.id, time: 300000 }); @@ -128,11 +128,13 @@ export class ButtonPaginator { } protected async edit(interaction: MessageComponentInteraction) { - return interaction?.update({ - content: this.text, - embeds: [this.embeds[this.curPage]], - components: [this.getPaginationRow()] - }).catch(() => null); + return interaction + ?.update({ + content: this.text, + embeds: [this.embeds[this.curPage]], + components: [this.getPaginationRow()] + }) + .catch(() => null); } protected getPaginationRow(disableAll = false): MessageActionRow { diff --git a/src/lib/common/DeleteButton.ts b/src/lib/common/DeleteButton.ts index 4792cf7..38ce6df 100644 --- a/src/lib/common/DeleteButton.ts +++ b/src/lib/common/DeleteButton.ts @@ -25,7 +25,7 @@ export class DeleteButton { const msg = (await this.message.util.reply(this.messageOptions)) as BushMessage; const collector = msg.createMessageComponentCollector({ - filter: (interaction) => interaction.customId == 'paginate__stop' && interaction.message.id == msg.id, + filter: (interaction) => interaction.customId == 'paginate__stop' && interaction.message?.id == msg.id, time: 300000 }); diff --git a/src/lib/common/Moderation.ts b/src/lib/common/Moderation.ts index 13ebf69..a7a037f 100644 --- a/src/lib/common/Moderation.ts +++ b/src/lib/common/Moderation.ts @@ -1,12 +1,12 @@ import { - ActivePunishment, - ActivePunishmentType, - Guild, - ModLog, - ModLogType, - type BushGuildMember, - type BushGuildMemberResolvable, - type BushGuildResolvable + ActivePunishment, + ActivePunishmentType, + Guild, + ModLog, + ModLogType, + type BushGuildMember, + type BushGuildMemberResolvable, + type BushGuildResolvable } from '#lib'; import { type Snowflake } from 'discord.js'; diff --git a/src/lib/common/typings/BushInspectOptions.d.ts b/src/lib/common/typings/BushInspectOptions.d.ts index e51e758..38c70b1 100644 --- a/src/lib/common/typings/BushInspectOptions.d.ts +++ b/src/lib/common/typings/BushInspectOptions.d.ts @@ -42,7 +42,7 @@ export interface BushInspectOptions extends InspectOptions { * **Default**: `false`. */ showProxy?: boolean | undefined; - + /** * Specifies the maximum number of `Array`, [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) elements to include when formatting. Set to `null` or `Infinity` to @@ -88,7 +88,7 @@ export interface BushInspectOptions extends InspectOptions { * **Default**: `false`. */ sorted?: boolean | ((a: string, b: string) => number) | undefined; - + /** * If set to `true`, getters are inspected. If set to `'get'`, only getters without a * corresponding setter are inspected. If set to `'set'`, only getters with a |