diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-02-19 18:52:41 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-02-19 18:52:41 -0500 |
commit | e78beed6c7e094ef48aad5d18da01b2bbed4536c (patch) | |
tree | 32676793af5f7bdc39d438ff284fa5b959274e96 /src/lib/extensions/discord.js | |
parent | a3103b629250de3fb97a40a4f9ff7e7ba28f4d16 (diff) | |
download | tanzanite-e78beed6c7e094ef48aad5d18da01b2bbed4536c.tar.gz tanzanite-e78beed6c7e094ef48aad5d18da01b2bbed4536c.tar.bz2 tanzanite-e78beed6c7e094ef48aad5d18da01b2bbed4536c.zip |
fix: a ton of shit
Diffstat (limited to 'src/lib/extensions/discord.js')
-rw-r--r-- | src/lib/extensions/discord.js/BushCategoryChannel.ts | 11 | ||||
-rw-r--r-- | src/lib/extensions/discord.js/BushCategoryChannelChildManager.ts | 52 | ||||
-rw-r--r-- | src/lib/extensions/discord.js/other.ts | 2 |
3 files changed, 58 insertions, 7 deletions
diff --git a/src/lib/extensions/discord.js/BushCategoryChannel.ts b/src/lib/extensions/discord.js/BushCategoryChannel.ts index ac82bf0..3868b54 100644 --- a/src/lib/extensions/discord.js/BushCategoryChannel.ts +++ b/src/lib/extensions/discord.js/BushCategoryChannel.ts @@ -2,7 +2,6 @@ import { BushDMChannel, BushGuildBasedChannel, BushNewsChannel, - BushNonThreadGuildBasedChannel, BushStageChannel, BushStoreChannel, BushTextBasedChannel, @@ -10,11 +9,11 @@ import { BushThreadChannel, BushVoiceBasedChannel, BushVoiceChannel, + type BushCategoryChannelChildManager, type BushClient, - type BushGuild, - type BushGuildMember + type BushGuild } from '#lib'; -import { CategoryChannel, type Collection, type Snowflake } from 'discord.js'; +import { CategoryChannel } from 'discord.js'; import { type RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; /** @@ -22,10 +21,8 @@ import { type RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; */ export class BushCategoryChannel extends CategoryChannel { public declare readonly client: BushClient; - public declare readonly children: Collection<Snowflake, Exclude<BushNonThreadGuildBasedChannel, BushCategoryChannel>>; + public declare readonly children: BushCategoryChannelChildManager; public declare guild: BushGuild; - public declare readonly members: Collection<Snowflake, BushGuildMember>; - public declare readonly parent: CategoryChannel | null; public constructor(guild: BushGuild, data?: RawGuildChannelData, client?: BushClient, immediatePatch?: boolean) { super(guild, data, client, immediatePatch); diff --git a/src/lib/extensions/discord.js/BushCategoryChannelChildManager.ts b/src/lib/extensions/discord.js/BushCategoryChannelChildManager.ts new file mode 100644 index 0000000..b9a7ac7 --- /dev/null +++ b/src/lib/extensions/discord.js/BushCategoryChannelChildManager.ts @@ -0,0 +1,52 @@ +/* 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'; + +export declare class BushCategoryChannelChildManager extends DataManager< + Snowflake, + BushNonCategoryGuildBasedChannel, + BushGuildChannelResolvable +> { + private constructor(channel: BushCategoryChannel); + + /** + * The category channel this manager belongs to + */ + public channel: BushCategoryChannel; + + /** + * The guild this manager belongs to + */ + public readonly guild: BushGuild; + + /** + * 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 + */ + public create<T extends Exclude<CategoryChannelType, ChannelType.GuildStore>>( + 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/other.ts b/src/lib/extensions/discord.js/other.ts index 784442d..e4bc10b 100644 --- a/src/lib/extensions/discord.js/other.ts +++ b/src/lib/extensions/discord.js/other.ts @@ -161,3 +161,5 @@ export enum BushInteractionType { MessageComponent = 3, ApplicationCommandAutocomplete = 4 } + +export type BushNonCategoryGuildBasedChannel = Exclude<BushGuildBasedChannel, BushCategoryChannel>; |