diff options
Diffstat (limited to 'src/lib/extensions')
23 files changed, 69 insertions, 160 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts index 2fb559c..6516161 100644 --- a/src/lib/extensions/discord-akairo/BushClient.ts +++ b/src/lib/extensions/discord-akairo/BushClient.ts @@ -22,10 +22,11 @@ import type { } from '#lib'; import { patch, type PatchedElements } from '@notenoughupdates/events-intercept'; import * as Sentry from '@sentry/node'; -import { AkairoClient, ContextMenuCommandHandler, version as akairoVersion } from 'discord-akairo'; -import { GatewayIntentBits } from 'discord-api-types/v9'; +import { AkairoClient, ContextMenuCommandHandler, PromptContentModifier, version as akairoVersion } from 'discord-akairo'; +import { GatewayIntentBits } from 'discord-api-types/v10'; import { ActivityType, + MessagePayload, Options, Partials, Structures, @@ -36,7 +37,6 @@ import { type Message, type MessageEditOptions, type MessageOptions, - type MessagePayload, type ReplyMessageOptions, type Snowflake, type WebhookEditMessageOptions @@ -78,7 +78,6 @@ import { BushNewsChannel } from '../discord.js/BushNewsChannel.js'; import { BushPresence } from '../discord.js/BushPresence.js'; import { BushRole } from '../discord.js/BushRole.js'; import { BushSelectMenuInteraction } from '../discord.js/BushSelectMenuInteraction.js'; -import { BushStoreChannel } from '../discord.js/BushStoreChannel.js'; import { BushTextChannel } from '../discord.js/BushTextChannel.js'; import { BushThreadChannel } from '../discord.js/BushThreadChannel.js'; import { BushThreadMember } from '../discord.js/BushThreadMember.js'; @@ -235,6 +234,17 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re directory: path.join(__dirname, '..', '..', '..', 'tasks'), automateCategories: true }); + + const modify: PromptContentModifier = async (message, text, data) => { + const ending = '\n\n Type **cancel** to cancel the command'; + const options = typeof text === 'function' ? await text(message, data) : text; + if (typeof options === 'string') return text + ending; + if (options instanceof MessagePayload) { + if (options.options.content) options.options.content += ending; + } else options.content += ending; + return options; + }; + this.commandHandler = new BushCommandHandler(this, { directory: path.join(__dirname, '..', '..', '..', 'commands'), prefix: async ({ guild }: Message) => { @@ -251,9 +261,8 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re prompt: { start: 'Placeholder argument prompt. **If you see this please tell my developers**.', retry: 'Placeholder failed argument prompt. **If you see this please tell my developers**.', - modifyStart: (_: Message, str: string): string => `${str}\n\n Type \`cancel\` to cancel the command`, - modifyRetry: (_: Message, str: string): string => - `${str.replace('{error}', this.util.emojis.error)}\n\n Type \`cancel\` to cancel the command`, + modifyStart: modify, + modifyRetry: modify, timeout: ':hourglass: You took too long the command has been cancelled.', ended: 'You exceeded the maximum amount of tries the command has been cancelled', cancel: 'The command has been cancelled', @@ -317,7 +326,6 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re Structures.extend('VoiceChannel', () => BushVoiceChannel); Structures.extend('CategoryChannel', () => BushCategoryChannel); Structures.extend('NewsChannel', () => BushNewsChannel); - Structures.extend('StoreChannel', () => BushStoreChannel); Structures.extend('ThreadChannel', () => BushThreadChannel); Structures.extend('GuildMember', () => BushGuildMember); Structures.extend('ThreadMember', () => BushThreadMember); diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts index e92abe7..563df3d 100644 --- a/src/lib/extensions/discord-akairo/BushClientUtil.ts +++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts @@ -22,10 +22,10 @@ import assert from 'assert'; import { exec } from 'child_process'; import deepLock from 'deep-lock'; import { ClientUtil, Util as AkairoUtil } from 'discord-akairo'; -import { APIEmbed, APIMessage, OAuth2Scopes, Routes } from 'discord-api-types/v9'; +import { APIEmbed, APIMessage, OAuth2Scopes, Routes } from 'discord-api-types/v10'; import { Constants as DiscordConstants, - Embed, + EmbedBuilder, GuildMember, Message, PermissionFlagsBits, @@ -920,7 +920,11 @@ export class BushClientUtil extends ClientUtil { */ public get invite() { return client.generateInvite({ - permissions: PermissionsBitField.All, + permissions: + PermissionsBitField.All - + PermissionFlagsBits.UseEmbeddedActivities - + PermissionFlagsBits.ViewGuildInsights - + PermissionFlagsBits.Stream, scopes: [OAuth2Scopes.Bot, OAuth2Scopes.ApplicationsCommands] }); } @@ -970,17 +974,17 @@ export class BushClientUtil extends ClientUtil { * @param embed The options to be applied to the (first) embed. * @param lines Each line of the description as an element in an array. */ - public overflowEmbed(embed: Omit<APIEmbed, 'description'>, lines: string[], maxLength = 4096): Embed[] { - const embeds: Embed[] = []; + public overflowEmbed(embed: Omit<APIEmbed, 'description'>, lines: string[], maxLength = 4096): EmbedBuilder[] { + const embeds: EmbedBuilder[] = []; const makeEmbed = () => { - embeds.push(new Embed().setColor(embed.color ?? null)); + embeds.push(new EmbedBuilder().setColor(embed.color ?? null)); return embeds.at(-1)!; }; for (const line of lines) { let current = embeds.length ? embeds.at(-1)! : makeEmbed(); - const joined = current.description ? `${current.description}\n${line}` : line; + const joined = current.data.description ? `${current.data.description}\n${line}` : line; if (joined.length >= maxLength) current = makeEmbed(); current.setDescription(joined); diff --git a/src/lib/extensions/discord-akairo/BushCommand.ts b/src/lib/extensions/discord-akairo/BushCommand.ts index ff3748e..febe95a 100644 --- a/src/lib/extensions/discord-akairo/BushCommand.ts +++ b/src/lib/extensions/discord-akairo/BushCommand.ts @@ -18,7 +18,6 @@ import { type BushRole, type BushSlashMessage, type BushStageChannel, - type BushStoreChannel, type BushTask, type BushTextChannel, type BushThreadChannel, @@ -72,10 +71,6 @@ export interface OverriddenBaseArgumentType extends BaseArgumentType { categoryChannels: Collection<string, BushCategoryChannel> | null; newsChannel: BushNewsChannel | null; newsChannels: Collection<string, BushNewsChannel> | null; - // eslint-disable-next-line deprecation/deprecation - storeChannel: BushStoreChannel | null; - // eslint-disable-next-line deprecation/deprecation - storeChannels: Collection<string, BushStoreChannel> | null; stageChannel: BushStageChannel | null; stageChannels: Collection<string, BushStageChannel> | null; threadChannel: BushThreadChannel | null; diff --git a/src/lib/extensions/discord.js/BushApplicationCommandManager.ts b/src/lib/extensions/discord.js/BushApplicationCommandManager.ts index 68153b9..dc27dbf 100644 --- a/src/lib/extensions/discord.js/BushApplicationCommandManager.ts +++ b/src/lib/extensions/discord.js/BushApplicationCommandManager.ts @@ -6,7 +6,7 @@ import type { BushGuildResolvable, StripPrivate } from '#lib'; -import type { APIApplicationCommand } from 'discord-api-types/v9'; +import type { APIApplicationCommand } from 'discord-api-types/v10'; import { ApplicationCommandManager, CachedManager, diff --git a/src/lib/extensions/discord.js/BushApplicationCommandPermissionsManager.ts b/src/lib/extensions/discord.js/BushApplicationCommandPermissionsManager.ts index 49d4234..401f3e2 100644 --- a/src/lib/extensions/discord.js/BushApplicationCommandPermissionsManager.ts +++ b/src/lib/extensions/discord.js/BushApplicationCommandPermissionsManager.ts @@ -1,5 +1,5 @@ import type { BushClient, BushRoleResolvable, BushUserResolvable } from '#lib'; -import type { APIApplicationCommandPermission } from 'discord-api-types/v9'; +import type { APIApplicationCommandPermission } from 'discord-api-types/v10'; import { ApplicationCommandPermissionType, BaseManager, diff --git a/src/lib/extensions/discord.js/BushButtonInteraction.ts b/src/lib/extensions/discord.js/BushButtonInteraction.ts index 89cfabd..368d19d 100644 --- a/src/lib/extensions/discord.js/BushButtonInteraction.ts +++ b/src/lib/extensions/discord.js/BushButtonInteraction.ts @@ -1,5 +1,5 @@ import type { BushClient, BushGuild, BushGuildMember, BushGuildTextBasedChannel, BushTextBasedChannel, BushUser } from '#lib'; -import type { APIInteractionGuildMember } from 'discord-api-types/v9'; +import type { APIInteractionGuildMember } from 'discord-api-types/v10'; import { ButtonInteraction, type CacheType, type CacheTypeReducer } from 'discord.js'; import type { RawMessageButtonInteractionData } from 'discord.js/typings/rawDataTypes'; diff --git a/src/lib/extensions/discord.js/BushCategoryChannel.ts b/src/lib/extensions/discord.js/BushCategoryChannel.ts index 8c02a68..a2e1e1c 100644 --- a/src/lib/extensions/discord.js/BushCategoryChannel.ts +++ b/src/lib/extensions/discord.js/BushCategoryChannel.ts @@ -3,7 +3,6 @@ import { BushGuildBasedChannel, BushNewsChannel, BushStageChannel, - BushStoreChannel, BushTextBasedChannel, BushTextChannel, BushThreadChannel, @@ -35,8 +34,6 @@ export interface BushCategoryChannel extends CategoryChannel { isVoice(): this is BushVoiceChannel; isCategory(): this is BushCategoryChannel; isNews(): this is BushNewsChannel; - // eslint-disable-next-line deprecation/deprecation - isStore(): this is BushStoreChannel; isThread(): this is BushThreadChannel; isStage(): this is BushStageChannel; isTextBased(): this is BushGuildBasedChannel & BushTextBasedChannel; diff --git a/src/lib/extensions/discord.js/BushCategoryChannelChildManager.ts b/src/lib/extensions/discord.js/BushCategoryChannelChildManager.ts index b9a7ac7..2b0d56b 100644 --- a/src/lib/extensions/discord.js/BushCategoryChannelChildManager.ts +++ b/src/lib/extensions/discord.js/BushCategoryChannelChildManager.ts @@ -1,20 +1,23 @@ -/* eslint-disable deprecation/deprecation */ import type { BushCategoryChannel, BushGuild, BushGuildChannelResolvable, BushMappedChannelCategoryTypes, BushNonCategoryGuildBasedChannel, - BushStoreChannel, BushTextChannel } from '#lib'; -import type { CategoryChannelType, CategoryCreateChannelOptions, ChannelType, DataManager, Snowflake } from 'discord.js'; +import type { + CategoryChannelChildManager, + CategoryChannelType, + CategoryCreateChannelOptions, + DataManager, + Snowflake +} from 'discord.js'; -export declare class BushCategoryChannelChildManager extends DataManager< - Snowflake, - BushNonCategoryGuildBasedChannel, - BushGuildChannelResolvable -> { +export declare class BushCategoryChannelChildManager + extends DataManager<Snowflake, BushNonCategoryGuildBasedChannel, BushGuildChannelResolvable> + implements CategoryChannelChildManager +{ private constructor(channel: BushCategoryChannel); /** @@ -33,20 +36,9 @@ export declare class BushCategoryChannelChildManager extends DataManager< * @param name The name of the new channel * @param options Options for creating the new channel */ - public create<T extends Exclude<CategoryChannelType, ChannelType.GuildStore>>( + public create<T extends CategoryChannelType>( name: string, options: CategoryCreateChannelOptions & { type: T } ): Promise<BushMappedChannelCategoryTypes[T]>; - /** - * Creates a new channel within this category. - * <info>You cannot create a channel of type {@link ChannelType.GuildCategory} inside a CategoryChannel.</info> - * @param name The name of the new channel - * @param options Options for creating the new channel - * @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/4414590563479) for more information - */ - public create( - name: string, - options: CategoryCreateChannelOptions & { type: ChannelType.GuildStore } - ): Promise<BushStoreChannel>; public create(name: string, options?: CategoryCreateChannelOptions): Promise<BushTextChannel>; } diff --git a/src/lib/extensions/discord.js/BushChannel.ts b/src/lib/extensions/discord.js/BushChannel.ts index 3f0d070..e66135c 100644 --- a/src/lib/extensions/discord.js/BushChannel.ts +++ b/src/lib/extensions/discord.js/BushChannel.ts @@ -1,11 +1,9 @@ -/* eslint-disable deprecation/deprecation */ import type { BushCategoryChannel, BushClient, BushDMChannel, BushNewsChannel, BushStageChannel, - BushStoreChannel, BushTextBasedChannel, BushTextChannel, BushThreadChannel, @@ -34,7 +32,6 @@ export declare class BushChannel extends Channel { public isVoice(): this is BushVoiceChannel; public isCategory(): this is BushCategoryChannel; public isNews(): this is BushNewsChannel; - public isStore(): this is BushStoreChannel; public isThread(): this is BushThreadChannel; public isStage(): this is BushStageChannel; public isTextBased(): this is BushTextBasedChannel; diff --git a/src/lib/extensions/discord.js/BushChatInputCommandInteraction.ts b/src/lib/extensions/discord.js/BushChatInputCommandInteraction.ts index 5dbf7b9..2491a68 100644 --- a/src/lib/extensions/discord.js/BushChatInputCommandInteraction.ts +++ b/src/lib/extensions/discord.js/BushChatInputCommandInteraction.ts @@ -10,7 +10,7 @@ import type { BushTextBasedChannel, BushUser } from '#lib'; -import type { APIInteractionGuildMember } from 'discord-api-types/v9'; +import type { APIInteractionGuildMember } from 'discord-api-types/v10'; import { ChatInputCommandInteraction, type CacheType, type CacheTypeReducer, type Invite, type Snowflake } from 'discord.js'; import type { RawCommandInteractionData } from 'discord.js/typings/rawDataTypes'; diff --git a/src/lib/extensions/discord.js/BushClientEvents.ts b/src/lib/extensions/discord.js/BushClientEvents.ts index 4a10ce5..fc9993e 100644 --- a/src/lib/extensions/discord.js/BushClientEvents.ts +++ b/src/lib/extensions/discord.js/BushClientEvents.ts @@ -97,7 +97,8 @@ export interface BushClientEvents extends AkairoClientEvents { reaction: BushMessageReaction | PartialBushMessageReaction ]; messageDeleteBulk: [ - messages: Collection<Snowflake, BushMessage | PartialBushMessage> + messages: Collection<Snowflake, BushMessage | PartialBushMessage>, + channel: BushTextBasedChannel ]; messageReactionAdd: [ reaction: BushMessageReaction | PartialBushMessageReaction, @@ -119,14 +120,18 @@ export interface BushClientEvents extends AkairoClientEvents { roleUpdate: [oldRole: BushRole, newRole: BushRole]; threadCreate: [thread: BushThreadChannel, newlyCreated: boolean]; threadDelete: [thread: BushThreadChannel]; - threadListSync: [threads: Collection<Snowflake, BushThreadChannel>]; + threadListSync: [ + threads: Collection<Snowflake, BushThreadChannel>, + guild: BushGuild + ]; threadMemberUpdate: [ oldMember: BushThreadMember, newMember: BushThreadMember ]; threadMembersUpdate: [ oldMembers: Collection<Snowflake, BushThreadMember>, - newMembers: Collection<Snowflake, BushThreadMember> + newMembers: Collection<Snowflake, BushThreadMember>, + thread: BushThreadChannel ]; threadUpdate: [oldThread: BushThreadChannel, newThread: BushThreadChannel]; typingStart: [typing: Typing]; diff --git a/src/lib/extensions/discord.js/BushDMChannel.ts b/src/lib/extensions/discord.js/BushDMChannel.ts index dc7d309..87382ec 100644 --- a/src/lib/extensions/discord.js/BushDMChannel.ts +++ b/src/lib/extensions/discord.js/BushDMChannel.ts @@ -1,11 +1,9 @@ -/* eslint-disable deprecation/deprecation */ import type { BushCategoryChannel, BushClient, BushMessageManager, BushNewsChannel, BushStageChannel, - BushStoreChannel, BushTextBasedChannel, BushTextChannel, BushThreadChannel, @@ -36,7 +34,6 @@ export interface BushDMChannel extends DMChannel { isVoice(): this is BushVoiceChannel; isCategory(): this is BushCategoryChannel; isNews(): this is BushNewsChannel; - isStore(): this is BushStoreChannel; isThread(): this is BushThreadChannel; isStage(): this is BushStageChannel; isTextBased(): this is BushTextBasedChannel; diff --git a/src/lib/extensions/discord.js/BushGuild.ts b/src/lib/extensions/discord.js/BushGuild.ts index b0a34e7..8b1b5fa 100644 --- a/src/lib/extensions/discord.js/BushGuild.ts +++ b/src/lib/extensions/discord.js/BushGuild.ts @@ -20,7 +20,7 @@ import { type GuildLogType, type GuildModel } from '#lib'; -import { APIMessage } from 'discord-api-types/v9'; +import { APIMessage } from 'discord-api-types/v10'; import { Collection, Guild, diff --git a/src/lib/extensions/discord.js/BushGuildChannel.ts b/src/lib/extensions/discord.js/BushGuildChannel.ts index dd523e5..62bf05a 100644 --- a/src/lib/extensions/discord.js/BushGuildChannel.ts +++ b/src/lib/extensions/discord.js/BushGuildChannel.ts @@ -1,4 +1,3 @@ -/* eslint-disable deprecation/deprecation */ import type { BushCategoryChannel, BushClient, @@ -7,7 +6,6 @@ import type { BushGuildBasedChannel, BushNewsChannel, BushStageChannel, - BushStoreChannel, BushTextBasedChannel, BushTextChannel, BushThreadChannel, @@ -42,7 +40,6 @@ export interface BushGuildChannel extends GuildChannel { isVoice(): this is BushVoiceChannel; isCategory(): this is BushCategoryChannel; isNews(): this is BushNewsChannel; - isStore(): this is BushStoreChannel; isThread(): this is BushThreadChannel; isStage(): this is BushStageChannel; isTextBased(): this is BushGuildBasedChannel & BushTextBasedChannel; diff --git a/src/lib/extensions/discord.js/BushGuildChannelManager.ts b/src/lib/extensions/discord.js/BushGuildChannelManager.ts index 91bff07..4048b98 100644 --- a/src/lib/extensions/discord.js/BushGuildChannelManager.ts +++ b/src/lib/extensions/discord.js/BushGuildChannelManager.ts @@ -5,13 +5,11 @@ import type { BushGuildChannel, BushMappedGuildChannelTypes, BushNonThreadGuildBasedChannel, - BushStoreChannel, BushTextChannel } from '#lib'; import { CachedManager, ChannelData, - ChannelType, ChannelWebhookCreateOptions, SetChannelPositionOptions, Webhook, @@ -67,38 +65,10 @@ export declare class BushGuildChannelManager * ], * }) */ - public create<T extends Exclude<GuildChannelTypes, ChannelType.GuildStore>>( + public create<T extends GuildChannelTypes>( name: string, options: GuildChannelCreateOptions & { type: T } ): Promise<BushMappedGuildChannelTypes[T]>; - - /** - * Creates a new channel in the guild. - * @param name The name of the new channel - * @param options Options for creating the new channel - * @example - * // Create a new text channel - * guild.channels.create('new-general', { reason: 'Needed a cool new channel' }) - * .then(console.log) - * .catch(console.error); - * @example - * // Create a new channel with permission overwrites - * guild.channels.create('new-voice', { - * type: 'GuildVoice', - * permissionOverwrites: [ - * { - * id: message.author.id, - * deny: [PermissionFlagsBits.ViewChannel], - * }, - * ], - * }) - * @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/4414590563479) for more information - */ - public create( - name: string, - options: GuildChannelCreateOptions & { type: ChannelType.GuildStore } - ): // eslint-disable-next-line deprecation/deprecation - Promise<BushStoreChannel>; public create(name: string, options?: GuildChannelCreateOptions): Promise<BushTextChannel>; /** diff --git a/src/lib/extensions/discord.js/BushMessageManager.ts b/src/lib/extensions/discord.js/BushMessageManager.ts index 80b7a21..edb7982 100644 --- a/src/lib/extensions/discord.js/BushMessageManager.ts +++ b/src/lib/extensions/discord.js/BushMessageManager.ts @@ -1,9 +1,9 @@ import { BushMessageResolvable, BushTextBasedChannel, type BushMessage } from '#lib'; import { CachedManager, + FetchMessageOptions, + FetchMessagesOptions, MessageManager, - type BaseFetchOptions, - type ChannelLogsQueryOptions, type Collection, type EmojiIdentifierResolvable, type MessageEditOptions, @@ -72,8 +72,8 @@ export declare class BushMessageManager * .then(messages => console.log(`${messages.filter(m => m.author.id === '84484653687267328').size} messages`)) * .catch(console.error); */ - public fetch(message: Snowflake, options?: BaseFetchOptions): Promise<BushMessage>; - public fetch(options?: ChannelLogsQueryOptions, cacheOptions?: BaseFetchOptions): Promise<Collection<Snowflake, BushMessage>>; + public fetch(options: BushMessageResolvable | FetchMessageOptions): Promise<BushMessage>; + public fetch(options?: FetchMessagesOptions): Promise<Collection<Snowflake, BushMessage>>; /** * Fetches the pinned messages of this channel and returns a collection of them. @@ -107,3 +107,7 @@ export declare class BushMessageManager */ public unpin(message: BushMessageResolvable): Promise<void>; } + +export interface BushFetchMessageOptions extends FetchMessageOptions { + message: BushMessageResolvable; +} diff --git a/src/lib/extensions/discord.js/BushModalSubmitInteraction.ts b/src/lib/extensions/discord.js/BushModalSubmitInteraction.ts index b05c0d7..9bdc9e5 100644 --- a/src/lib/extensions/discord.js/BushModalSubmitInteraction.ts +++ b/src/lib/extensions/discord.js/BushModalSubmitInteraction.ts @@ -7,9 +7,10 @@ import type { BushTextBasedChannel, BushUser } from '#lib'; -import type { APIInteractionGuildMember, APIModalSubmitInteraction } from 'discord-api-types/v9'; +import type { APIInteractionGuildMember, APIModalSubmitInteraction } from 'discord-api-types/v10'; import { InteractionDeferUpdateOptions, + InteractionResponse, InteractionUpdateOptions, MessagePayload, ModalSubmitInteraction, @@ -49,7 +50,7 @@ export interface BushModalMessageModalSubmitInteraction<Cached extends CacheType /** * The message associated with this interaction */ - message: BushGuildCacheMessage<Cached> | null; + message: BushGuildCacheMessage<Cached>; /** * Updates the original message of the component on which the interaction was received on. @@ -64,7 +65,7 @@ export interface BushModalMessageModalSubmitInteraction<Cached extends CacheType * .catch(console.error); */ update(options: InteractionUpdateOptions & { fetchReply: true }): Promise<BushGuildCacheMessage<Cached>>; - update(options: string | MessagePayload | InteractionUpdateOptions): Promise<void>; + update(options: string | MessagePayload | InteractionUpdateOptions): Promise<InteractionResponse>; /** * Defers an update to the message to which the component was attached. @@ -76,7 +77,7 @@ export interface BushModalMessageModalSubmitInteraction<Cached extends CacheType * .catch(console.error); */ deferUpdate(options: InteractionDeferUpdateOptions & { fetchReply: true }): Promise<BushGuildCacheMessage<Cached>>; - deferUpdate(options?: InteractionDeferUpdateOptions): Promise<void>; + deferUpdate(options?: InteractionDeferUpdateOptions): Promise<InteractionResponse>; /** * Indicates whether this interaction is received from a guild. diff --git a/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts b/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts index 35e6301..66a5ea9 100644 --- a/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts +++ b/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts @@ -1,5 +1,5 @@ import type { BushClient, BushGuild, BushGuildMember, BushGuildTextBasedChannel, BushTextBasedChannel, BushUser } from '#lib'; -import type { APIInteractionGuildMember } from 'discord-api-types/v9'; +import type { APIInteractionGuildMember } from 'discord-api-types/v10'; import { SelectMenuInteraction, type CacheType, type CacheTypeReducer } from 'discord.js'; import type { RawMessageSelectMenuInteractionData } from 'discord.js/typings/rawDataTypes'; diff --git a/src/lib/extensions/discord.js/BushStoreChannel.ts b/src/lib/extensions/discord.js/BushStoreChannel.ts deleted file mode 100644 index a2cc114..0000000 --- a/src/lib/extensions/discord.js/BushStoreChannel.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* eslint-disable deprecation/deprecation */ -import type { - BushCategoryChannel, - BushClient, - BushDMChannel, - BushGuild, - BushGuildBasedChannel, - BushGuildMember, - BushNewsChannel, - BushStageChannel, - BushTextBasedChannel, - BushTextChannel, - BushThreadChannel, - BushVoiceBasedChannel, - BushVoiceChannel -} from '#lib'; -import { PartialGroupDMChannel, StoreChannel, type Collection, type Snowflake } from 'discord.js'; -import type { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; - -/** - * Represents a guild store channel on Discord. - * @deprecated Store channels are deprecated and will be removed from Discord in March 2022. See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/4414590563479) for more information - */ -export class BushStoreChannel extends StoreChannel { - public declare guild: BushGuild; - - public constructor(guild: BushGuild, data?: RawGuildChannelData, client?: BushClient) { - super(guild, data, client); - } -} - -export interface BushStoreChannel extends StoreChannel { - get members(): Collection<Snowflake, BushGuildMember>; - get parent(): BushCategoryChannel | null; - isText(): this is BushTextChannel; - isDM(): this is BushDMChannel; - isDMBased(): this is PartialGroupDMChannel | BushDMChannel; - isVoice(): this is BushVoiceChannel; - isCategory(): this is BushCategoryChannel; - isNews(): this is BushNewsChannel; - isStore(): this is BushStoreChannel; - isThread(): this is BushThreadChannel; - isStage(): this is BushStageChannel; - isTextBased(): this is BushGuildBasedChannel & BushTextBasedChannel; - isVoiceBased(): this is BushVoiceBasedChannel; -} diff --git a/src/lib/extensions/discord.js/BushTextChannel.ts b/src/lib/extensions/discord.js/BushTextChannel.ts index ad54b76..575de20 100644 --- a/src/lib/extensions/discord.js/BushTextChannel.ts +++ b/src/lib/extensions/discord.js/BushTextChannel.ts @@ -1,4 +1,3 @@ -/* eslint-disable deprecation/deprecation */ import type { BushCategoryChannel, BushDMChannel, @@ -7,7 +6,6 @@ import type { BushMessageManager, BushNewsChannel, BushStageChannel, - BushStoreChannel, BushTextBasedChannel, BushThreadChannel, BushThreadManager, @@ -37,7 +35,6 @@ export interface BushTextChannel extends TextChannel { isVoice(): this is BushVoiceChannel; isCategory(): this is BushCategoryChannel; isNews(): this is BushNewsChannel; - isStore(): this is BushStoreChannel; isThread(): this is BushThreadChannel; isStage(): this is BushStageChannel; isTextBased(): this is BushGuildBasedChannel & BushTextBasedChannel; diff --git a/src/lib/extensions/discord.js/BushThreadChannel.ts b/src/lib/extensions/discord.js/BushThreadChannel.ts index 5663ba4..8b941f9 100644 --- a/src/lib/extensions/discord.js/BushThreadChannel.ts +++ b/src/lib/extensions/discord.js/BushThreadChannel.ts @@ -1,4 +1,3 @@ -/* eslint-disable deprecation/deprecation */ import type { BushCategoryChannel, BushClient, @@ -9,7 +8,6 @@ import type { BushMessageManager, BushNewsChannel, BushStageChannel, - BushStoreChannel, BushTextBasedChannel, BushTextChannel, BushThreadMemberManager, @@ -42,7 +40,6 @@ export interface BushThreadChannel extends ThreadChannel { isVoice(): this is BushVoiceChannel; isCategory(): this is BushCategoryChannel; isNews(): this is BushNewsChannel; - isStore(): this is BushStoreChannel; isThread(): this is BushThreadChannel; isStage(): this is BushStageChannel; isTextBased(): this is BushGuildBasedChannel & BushTextBasedChannel; diff --git a/src/lib/extensions/discord.js/BushVoiceChannel.ts b/src/lib/extensions/discord.js/BushVoiceChannel.ts index 6691045..6966727 100644 --- a/src/lib/extensions/discord.js/BushVoiceChannel.ts +++ b/src/lib/extensions/discord.js/BushVoiceChannel.ts @@ -1,4 +1,3 @@ -/* eslint-disable deprecation/deprecation */ import type { BushCategoryChannel, BushClient, @@ -8,7 +7,6 @@ import type { BushGuildMember, BushNewsChannel, BushStageChannel, - BushStoreChannel, BushTextBasedChannel, BushTextChannel, BushThreadChannel, @@ -35,7 +33,6 @@ export interface BushVoiceChannel extends VoiceChannel { isVoice(): this is BushVoiceChannel; isCategory(): this is BushCategoryChannel; isNews(): this is BushNewsChannel; - isStore(): this is BushStoreChannel; isThread(): this is BushThreadChannel; isStage(): this is BushStageChannel; isTextBased(): this is BushGuildBasedChannel & BushTextBasedChannel; diff --git a/src/lib/extensions/discord.js/other.ts b/src/lib/extensions/discord.js/other.ts index d7fb15b..086ace0 100644 --- a/src/lib/extensions/discord.js/other.ts +++ b/src/lib/extensions/discord.js/other.ts @@ -1,4 +1,3 @@ -/* eslint-disable deprecation/deprecation */ import type { BushApplicationCommand, BushCategoryChannel, @@ -11,7 +10,6 @@ import type { BushReactionEmoji, BushRole, BushStageChannel, - BushStoreChannel, BushTextChannel, BushThreadChannel, BushThreadMember, @@ -19,7 +17,7 @@ import type { BushVoiceChannel, PartialBushDMChannel } from '#lib'; -import { APIMessage } from 'discord-api-types/v9'; +import { APIMessage } from 'discord-api-types/v10'; import type { ApplicationCommandResolvable, CacheType, @@ -109,7 +107,6 @@ export type BushAnyChannel = | PartialBushDMChannel | BushNewsChannel | BushStageChannel - | BushStoreChannel | BushTextChannel | BushThreadChannel | BushVoiceChannel; @@ -146,8 +143,8 @@ export interface BushMappedChannelCategoryTypes { [ChannelType.GuildNews]: BushNewsChannel; [ChannelType.GuildVoice]: BushVoiceChannel; [ChannelType.GuildText]: BushTextChannel; - [ChannelType.GuildStore]: BushStoreChannel; [ChannelType.GuildStageVoice]: BushStageChannel; + [ChannelType.GuildForum]: never; // TODO: Fix when guild forums come out } export type BushMappedGuildChannelTypes = { |