diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/common/AutoMod.ts | 9 | ||||
-rw-r--r-- | src/lib/extensions/discord.js/BushButtonInteraction.ts | 10 | ||||
-rw-r--r-- | src/lib/extensions/discord.js/BushChannel.d.ts | 3 | ||||
-rw-r--r-- | src/lib/extensions/discord.js/BushCommandInteraction.ts | 10 | ||||
-rw-r--r-- | src/lib/extensions/discord.js/BushSelectMenuInteraction.ts | 10 |
5 files changed, 30 insertions, 12 deletions
diff --git a/src/lib/common/AutoMod.ts b/src/lib/common/AutoMod.ts index c52754a..932d457 100644 --- a/src/lib/common/AutoMod.ts +++ b/src/lib/common/AutoMod.ts @@ -32,8 +32,7 @@ export class AutoMod { */ private async handle() { if (this.message.channel.type === 'DM' || !this.message.guild) return; - const hasFeature = this.message.guild.hasFeature; - if (!(await hasFeature('automod'))) return; + if (!(await this.message.guild.hasFeature('automod'))) return; const customAutomodPhrases = (await this.message.guild.getSetting('autoModPhases')) ?? {}; const badLinks: BadWords = {}; @@ -52,8 +51,8 @@ export class AutoMod { const result = { ...this.checkWords(customAutomodPhrases), - ...this.checkWords((await hasFeature('excludeDefaultAutomod')) ? {} : badWords), - ...this.checkWords((await hasFeature('excludeAutomodScamLinks')) ? {} : badLinks) + ...this.checkWords((await this.message.guild.hasFeature('excludeDefaultAutomod')) ? {} : badWords), + ...this.checkWords((await this.message.guild.hasFeature('excludeAutomodScamLinks')) ? {} : badLinks) }; if (Object.keys(result).length === 0) return; @@ -77,7 +76,7 @@ export class AutoMod { void this.log(highestOffence, color, result); } - if (!this.punished && (await hasFeature('delScamMentions'))) void this.checkScamMentions(); + if (!this.punished && (await this.message.guild.hasFeature('delScamMentions'))) void this.checkScamMentions(); } /** diff --git a/src/lib/extensions/discord.js/BushButtonInteraction.ts b/src/lib/extensions/discord.js/BushButtonInteraction.ts index 9e62d46..18d6b35 100644 --- a/src/lib/extensions/discord.js/BushButtonInteraction.ts +++ b/src/lib/extensions/discord.js/BushButtonInteraction.ts @@ -1,10 +1,16 @@ -import type { BushClient, BushGuild, BushGuildMember, BushTextBasedChannels, BushUser } from '#lib'; +import type { BushClient, BushGuild, BushGuildMember, BushGuildTextBasedChannel, BushTextBasedChannels, BushUser } from '#lib'; import type { APIInteractionGuildMember } from 'discord-api-types/v9'; import { ButtonInteraction, type CacheType, type CacheTypeReducer } from 'discord.js'; import type { RawMessageButtonInteractionData } from 'discord.js/typings/rawDataTypes'; export class BushButtonInteraction<Cached extends CacheType = CacheType> extends ButtonInteraction<Cached> { - public declare readonly channel: CacheTypeReducer<Cached, BushTextBasedChannels | null>; + public declare readonly channel: CacheTypeReducer< + Cached, + BushGuildTextBasedChannel | null, + BushGuildTextBasedChannel | null, + BushGuildTextBasedChannel | null, + BushTextBasedChannels | null + >; public declare readonly guild: CacheTypeReducer<Cached, BushGuild, null>; public declare member: CacheTypeReducer<Cached, BushGuildMember, APIInteractionGuildMember>; public declare user: BushUser; diff --git a/src/lib/extensions/discord.js/BushChannel.d.ts b/src/lib/extensions/discord.js/BushChannel.d.ts index 9a78b9a..497c33a 100644 --- a/src/lib/extensions/discord.js/BushChannel.d.ts +++ b/src/lib/extensions/discord.js/BushChannel.d.ts @@ -7,7 +7,8 @@ export class BushChannel extends Channel { public constructor(client: BushClient, data?: RawChannelData, immediatePatch?: boolean); public readonly createdAt: Date; public readonly createdTimestamp: number; - public deleted: boolean; + public get deleted(): boolean; + public set deleted(value: boolean); public id: Snowflake; public readonly partial: false; public type: keyof typeof ChannelTypes; diff --git a/src/lib/extensions/discord.js/BushCommandInteraction.ts b/src/lib/extensions/discord.js/BushCommandInteraction.ts index b61ec9b..174fd9c 100644 --- a/src/lib/extensions/discord.js/BushCommandInteraction.ts +++ b/src/lib/extensions/discord.js/BushCommandInteraction.ts @@ -10,14 +10,20 @@ import type { import type { APIInteractionGuildMember } from 'discord-api-types/v9'; import { CommandInteraction, type CacheType, type CacheTypeReducer, type Invite, type Snowflake } from 'discord.js'; import type { RawCommandInteractionData } from 'discord.js/typings/rawDataTypes'; -import { BushTextBasedChannels, type BushClient } from '../discord-akairo/BushClient'; +import { BushGuildTextBasedChannel, BushTextBasedChannels, type BushClient } from '../discord-akairo/BushClient'; export type BushGuildResolvable = BushGuild | BushGuildChannel | BushGuildMember | BushGuildEmoji | Invite | BushRole | Snowflake; export class BushCommandInteraction<Cached extends CacheType = CacheType> extends CommandInteraction<Cached> { public declare readonly client: BushClient; public declare readonly command: BushApplicationCommand | BushApplicationCommand<{ guild: BushGuildResolvable }> | null; - public declare readonly channel: CacheTypeReducer<Cached, BushTextBasedChannels | null>; + public declare readonly channel: CacheTypeReducer< + Cached, + BushGuildTextBasedChannel | null, + BushGuildTextBasedChannel | null, + BushGuildTextBasedChannel | null, + BushTextBasedChannels | null + >; public declare readonly guild: CacheTypeReducer<Cached, BushGuild, null>; public declare member: CacheTypeReducer<Cached, BushGuildMember, APIInteractionGuildMember>; public declare user: BushUser; diff --git a/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts b/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts index 6b33c20..d33ddd3 100644 --- a/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts +++ b/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts @@ -1,10 +1,16 @@ -import type { BushClient, BushGuild, BushGuildMember, BushTextBasedChannels, BushUser } from '#lib'; +import type { BushClient, BushGuild, BushGuildMember, BushGuildTextBasedChannel, BushTextBasedChannels, BushUser } from '#lib'; import type { APIInteractionGuildMember } from 'discord-api-types/v9'; import { SelectMenuInteraction, type CacheType, type CacheTypeReducer } from 'discord.js'; import type { RawMessageSelectMenuInteractionData } from 'discord.js/typings/rawDataTypes'; export class BushSelectMenuInteraction<Cached extends CacheType = CacheType> extends SelectMenuInteraction<Cached> { - public declare readonly channel: CacheTypeReducer<Cached, BushTextBasedChannels | null>; + public declare readonly channel: CacheTypeReducer< + Cached, + BushGuildTextBasedChannel | null, + BushGuildTextBasedChannel | null, + BushGuildTextBasedChannel | null, + BushTextBasedChannels | null + >; public declare readonly guild: CacheTypeReducer<Cached, BushGuild, null>; public declare member: CacheTypeReducer<Cached, BushGuildMember, APIInteractionGuildMember>; public declare user: BushUser; |