diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-05 16:14:12 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-05 16:14:12 -0400 |
commit | ad2077fa157d49c1099f21ac2effe05903c39035 (patch) | |
tree | 4ada5fb9a6243d21411500dc46b203ace06718e1 | |
parent | dbb2de6e5c4b0cf80a5be8e62bbabaac2f3dd516 (diff) | |
download | tanzanite-ad2077fa157d49c1099f21ac2effe05903c39035.tar.gz tanzanite-ad2077fa157d49c1099f21ac2effe05903c39035.tar.bz2 tanzanite-ad2077fa157d49c1099f21ac2effe05903c39035.zip |
fixed ~500 errors from breaking changes
45 files changed, 181 insertions, 183 deletions
diff --git a/package.json b/package.json index 26a87fe..1cfd7e8 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "common-tags": "^1.8.0", "discord-akairo": "NotEnoughUpdates/discord-akairo", "discord-akairo-message-util": "NotEnoughUpdates/discord-akairo-message-util", - "discord-api-types": "0.21.0", + "discord-api-types": "0.22.0", "discord.js": "NotEnoughUpdates/discord.js", "discord.js-minesweeper": "^1.0.6", "fuse.js": "^6.4.6", @@ -130,13 +130,5 @@ "singleQuote": true, "trailingComma": "none" }, - "packageManager": "yarn@3.0.0", - "dependenciesMeta": { - "discord-akairo@8.2.2": { - "unplugged": true - }, - "discord-akairo-message-util@1.0.0": { - "unplugged": true - } - } + "packageManager": "yarn@3.0.0" } diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts index 42d3d13..d8705a3 100644 --- a/src/lib/extensions/discord-akairo/BushClientUtil.ts +++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts @@ -315,11 +315,11 @@ export class BushClientUtil extends ClientUtil { const style = Constants.MessageButtonStyles.PRIMARY; let curPage = 0; if (typeof embeds !== 'object') throw new Error('embeds must be an object'); - const msg: Message = await message.util.reply({ + const msg = (await message.util.reply({ content: text || null, embeds: [embeds[curPage]], components: [getPaginationRow()] - }); + })) as Message; const filter = (interaction: ButtonInteraction) => interaction.customId.startsWith('paginate_') && interaction.message == msg; const collector = msg.createMessageComponentCollector({ filter, time: 300000 }); @@ -409,7 +409,7 @@ export class BushClientUtil extends ClientUtil { public async sendWithDeleteButton(message: BushMessage | BushSlashMessage, options: MessageOptions): Promise<void> { const paginateEmojis = this.#paginateEmojis; updateOptions(); - const msg = await message.util.reply(options as MessageOptions & { split?: false }); + const msg = (await message.util.reply(options as MessageOptions & { split?: false })) as Message; const filter = (interaction: ButtonInteraction) => interaction.customId == 'paginate__stop' && interaction.message == msg; const collector = msg.createMessageComponentCollector({ filter, time: 300000 }); collector.on('collect', async (interaction: MessageComponentInteraction) => { diff --git a/src/lib/extensions/discord-akairo/BushSlashMessage.ts b/src/lib/extensions/discord-akairo/BushSlashMessage.ts index eee6ac2..215cf79 100644 --- a/src/lib/extensions/discord-akairo/BushSlashMessage.ts +++ b/src/lib/extensions/discord-akairo/BushSlashMessage.ts @@ -4,6 +4,7 @@ import { BushGuild } from '../discord.js/BushGuild'; import { BushGuildMember } from '../discord.js/BushGuildMember'; import { BushUser } from '../discord.js/BushUser'; import { BushClient } from './BushClient'; +import { BushCommand } from './BushCommand'; import { BushCommandUtil } from './BushCommandUtil'; export class BushSlashMessage extends AkairoMessage { @@ -12,11 +13,7 @@ export class BushSlashMessage extends AkairoMessage { public declare guild: BushGuild; public declare author: BushUser; public declare member: BushGuildMember; - public constructor( - client: BushClient, - interaction: CommandInteraction, - { slash, replied }: { slash?: boolean; replied?: boolean } - ) { - super(client, interaction, { slash, replied }); + public constructor(client: BushClient, interaction: CommandInteraction, command: BushCommand) { + super(client, interaction, command); } } diff --git a/src/lib/extensions/discord.js/BushActivity.ts b/src/lib/extensions/discord.js/BushActivity.ts index 4dc4e74..96c924d 100644 --- a/src/lib/extensions/discord.js/BushActivity.ts +++ b/src/lib/extensions/discord.js/BushActivity.ts @@ -1,10 +1,11 @@ import { Activity } from 'discord.js'; +import { RawActivityData } from 'discord.js/typings/rawDataTypes'; import { BushEmoji } from './BushEmoji'; import { BushPresence } from './BushPresence'; export class BushActivity extends Activity { public declare emoji: BushEmoji | null; - public constructor(presence: BushPresence, data?: unknown) { + public constructor(presence: BushPresence, data?: RawActivityData) { super(presence, data); } } diff --git a/src/lib/extensions/discord.js/BushApplicationCommand.ts b/src/lib/extensions/discord.js/BushApplicationCommand.ts index 171e2ad..0d7c000 100644 --- a/src/lib/extensions/discord.js/BushApplicationCommand.ts +++ b/src/lib/extensions/discord.js/BushApplicationCommand.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/ban-types */ -/* eslint-disable @typescript-eslint/no-unused-vars */ import { ApplicationCommand, Snowflake } from 'discord.js'; +import { RawApplicationCommandData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushGuild } from './BushGuild'; @@ -8,7 +8,7 @@ export class BushApplicationCommand<PermissionsFetchType = {}> extends Applicati public declare readonly client: BushClient; public declare guild: BushGuild | null; - public constructor(client: BushClient, data: unknown, guild?: BushGuild, guildID?: Snowflake) { + public constructor(client: BushClient, data: RawApplicationCommandData, guild?: BushGuild, guildID?: Snowflake) { super(client, data, guild, guildID); } } diff --git a/src/lib/extensions/discord.js/BushApplicationCommandManager.d.ts b/src/lib/extensions/discord.js/BushApplicationCommandManager.d.ts index 0e071ff..8eec9a7 100644 --- a/src/lib/extensions/discord.js/BushApplicationCommandManager.d.ts +++ b/src/lib/extensions/discord.js/BushApplicationCommandManager.d.ts @@ -1,4 +1,6 @@ +import { APIApplicationCommand } from 'discord-api-types'; import { ApplicationCommandData, CachedManager, Collection, FetchApplicationCommandOptions, Snowflake } from 'discord.js'; +import { RawApplicationCommandData } from 'discord.js/typings/rawDataTypes'; import { BushApplicationCommandResolvable, BushClient } from '../discord-akairo/BushClient'; import { BushApplicationCommand } from './BushApplicationCommand'; import { BushApplicationCommandPermissionsManager } from './BushApplicationCommandPermissionsManager'; @@ -9,8 +11,7 @@ export class BushApplicationCommandManager< PermissionsOptionsExtras = { guild: BushGuildResolvable }, PermissionsGuildType = null > extends CachedManager<Snowflake, ApplicationCommandType, BushApplicationCommandResolvable> { - public constructor(client: BushClient, iterable?: Iterable<unknown>); - public declare readonly client: BushClient; + public constructor(client: BushClient, iterable?: Iterable<RawApplicationCommandData>); public permissions: BushApplicationCommandPermissionsManager< { command?: BushApplicationCommandResolvable } & PermissionsOptionsExtras, { command: BushApplicationCommandResolvable } & PermissionsOptionsExtras, @@ -39,5 +40,7 @@ export class BushApplicationCommandManager< ): Promise<Collection<Snowflake, ApplicationCommandType>>; public set(commands: ApplicationCommandData[]): Promise<Collection<Snowflake, ApplicationCommandType>>; public set(commands: ApplicationCommandData[], guildId: Snowflake): Promise<Collection<Snowflake, BushApplicationCommand>>; - private static transformCommand(command: ApplicationCommandData): unknown; + private static transformCommand( + command: ApplicationCommandData + ): Omit<APIApplicationCommand, 'id' | 'application_id' | 'guild_id'>; } diff --git a/src/lib/extensions/discord.js/BushApplicationCommandPermissionsManager.d.ts b/src/lib/extensions/discord.js/BushApplicationCommandPermissionsManager.d.ts index 443fee2..ece4a60 100644 --- a/src/lib/extensions/discord.js/BushApplicationCommandPermissionsManager.d.ts +++ b/src/lib/extensions/discord.js/BushApplicationCommandPermissionsManager.d.ts @@ -1,3 +1,4 @@ +import { APIApplicationCommandPermission } from 'discord-api-types'; import { ApplicationCommand, ApplicationCommandManager, @@ -9,6 +10,7 @@ import { GuildApplicationCommandPermissionData, Snowflake } from 'discord.js'; +import { ApplicationCommandPermissionTypes } from 'discord.js/typings/enums'; import { BushClient, BushRoleResolvable, BushUserResolvable } from '../discord-akairo/BushClient'; export class BushApplicationCommandPermissionsManager< @@ -19,11 +21,12 @@ export class BushApplicationCommandPermissionsManager< CommandIdType > extends BaseManager { public constructor(manager: ApplicationCommandManager | GuildApplicationCommandManager | ApplicationCommand); - public declare readonly client: BushClient; + private manager: ApplicationCommandManager | GuildApplicationCommandManager | ApplicationCommand; + + public client: BushClient; public commandId: CommandIdType; public guild: GuildType; public guildId: Snowflake | null; - public manager: ApplicationCommandManager | GuildApplicationCommandManager | ApplicationCommand; public add( options: FetchSingleOptions & { permissions: ApplicationCommandPermissionData[] } ): Promise<ApplicationCommandPermissions[]>; @@ -50,5 +53,9 @@ export class BushApplicationCommandPermissionsManager< } ): Promise<Collection<Snowflake, ApplicationCommandPermissions[]>>; private permissionsPath(guildId: Snowflake, commandId?: Snowflake): unknown; - private static transformPermissions(permissions: ApplicationCommandPermissionData, received?: boolean): unknown; + private static transformPermissions( + permissions: ApplicationCommandPermissionData, + received: true + ): Omit<APIApplicationCommandPermission, 'type'> & { type: keyof ApplicationCommandPermissionTypes }; + private static transformPermissions(permissions: ApplicationCommandPermissionData): APIApplicationCommandPermission; } diff --git a/src/lib/extensions/discord.js/BushBaseGuildEmojiManager.d.ts b/src/lib/extensions/discord.js/BushBaseGuildEmojiManager.d.ts index 165ea6e..3e00d96 100644 --- a/src/lib/extensions/discord.js/BushBaseGuildEmojiManager.d.ts +++ b/src/lib/extensions/discord.js/BushBaseGuildEmojiManager.d.ts @@ -1,9 +1,10 @@ import { Snowflake } from 'discord-api-types'; import { CachedManager } from 'discord.js'; +import { RawGuildEmojiData } from 'discord.js/typings/rawDataTypes'; import { BushClient, BushEmojiIdentifierResolvable, BushEmojiResolvable } from '../discord-akairo/BushClient'; import { BushGuildEmoji } from './BushGuildEmoji'; export class BushBaseGuildEmojiManager extends CachedManager<Snowflake, BushGuildEmoji, BushEmojiResolvable> { - public constructor(client: BushClient, iterable?: Iterable<unknown>); + public constructor(client: BushClient, iterable?: Iterable<RawGuildEmojiData>); public resolveIdentifier(emoji: BushEmojiIdentifierResolvable): string | null; } diff --git a/src/lib/extensions/discord.js/BushBaseGuildTextChannel.ts b/src/lib/extensions/discord.js/BushBaseGuildTextChannel.ts new file mode 100644 index 0000000..734642e --- /dev/null +++ b/src/lib/extensions/discord.js/BushBaseGuildTextChannel.ts @@ -0,0 +1,18 @@ +import { AllowedThreadTypeForTextChannel, BaseGuildTextChannel, Collection, Snowflake } from 'discord.js'; +import { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; +import { BushCategoryChannel, BushClient, BushGuildMember } from '../..'; +import { BushGuild } from './BushGuild'; +import { BushMessageManager } from './BushMessageManager'; +import { BushThreadManager } from './BushThreadManager'; + +export class BushBaseGuildTextChannel extends BaseGuildTextChannel { + public constructor(guild: BushGuild, data?: RawGuildChannelData, client?: BushClient, immediatePatch?: boolean) { + super(guild, data, client, immediatePatch); + } + public declare messages: BushMessageManager; + public declare threads: BushThreadManager<AllowedThreadTypeForTextChannel>; + public declare readonly client: BushClient; + public declare guild: BushGuild; + public declare readonly members: Collection<Snowflake, BushGuildMember>; + public declare readonly parent: BushCategoryChannel | null; +} diff --git a/src/lib/extensions/discord.js/BushButtonInteraction.ts b/src/lib/extensions/discord.js/BushButtonInteraction.ts index 846786c..413522f 100644 --- a/src/lib/extensions/discord.js/BushButtonInteraction.ts +++ b/src/lib/extensions/discord.js/BushButtonInteraction.ts @@ -1,19 +1,17 @@ import { APIInteractionGuildMember } from 'discord-api-types/v9'; -import { ButtonInteraction, PartialDMChannel } from 'discord.js'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushDMChannel } from './BushDMChannel'; +import { ButtonInteraction } from 'discord.js'; +import { RawMessageButtonInteractionData } from 'discord.js/typings/rawDataTypes'; +import { BushClient, BushTextBasedChannels } from '../discord-akairo/BushClient'; import { BushGuild } from './BushGuild'; import { BushGuildMember } from './BushGuildMember'; -import { BushNewsChannel } from './BushNewsChannel'; -import { BushTextChannel } from './BushTextChannel'; import { BushUser } from './BushUser'; export class BushButtonInteraction extends ButtonInteraction { - public declare readonly channel: BushTextChannel | BushDMChannel | BushNewsChannel | PartialDMChannel | null; + public declare readonly channel: BushTextBasedChannels | null; public declare readonly guild: BushGuild | null; public declare member: BushGuildMember | APIInteractionGuildMember | null; public declare user: BushUser; - public constructor(client: BushClient, data: unknown) { + public constructor(client: BushClient, data: RawMessageButtonInteractionData) { super(client, data); } } diff --git a/src/lib/extensions/discord.js/BushCategoryChannel.ts b/src/lib/extensions/discord.js/BushCategoryChannel.ts index a66b2c6..f5d26f0 100644 --- a/src/lib/extensions/discord.js/BushCategoryChannel.ts +++ b/src/lib/extensions/discord.js/BushCategoryChannel.ts @@ -1,4 +1,5 @@ import { CategoryChannel, Collection, Snowflake } from 'discord.js'; +import { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushGuild } from './BushGuild'; import { BushGuildChannel } from './BushGuildChannel'; @@ -10,7 +11,7 @@ export class BushCategoryChannel extends CategoryChannel { public declare guild: BushGuild; public declare readonly members: Collection<Snowflake, BushGuildMember>; public declare readonly parent: CategoryChannel | null; - public constructor(guild: BushGuild, data?: unknown) { - super(guild, data); + public constructor(guild: BushGuild, data?: RawGuildChannelData, client?: BushClient, immediatePatch?: boolean) { + super(guild, data, client, immediatePatch); } } diff --git a/src/lib/extensions/discord.js/BushChannel.d.ts b/src/lib/extensions/discord.js/BushChannel.d.ts index 5aa3422..333ce06 100644 --- a/src/lib/extensions/discord.js/BushChannel.d.ts +++ b/src/lib/extensions/discord.js/BushChannel.d.ts @@ -1,11 +1,12 @@ import { Snowflake } from 'discord-api-types'; import { Channel, ChannelMention } from 'discord.js'; import { ChannelTypes } from 'discord.js/typings/enums'; +import { RawChannelData } from 'discord.js/typings/rawDataTypes'; import { BushClient, BushTextBasedChannels } from '../discord-akairo/BushClient'; import { BushThreadChannel } from './BushThreadChannel'; export class BushChannel extends Channel { - public constructor(client: BushClient, data?: unknown, immediatePatch?: boolean); + public constructor(client: BushClient, data?: RawChannelData, immediatePatch?: boolean); public readonly createdAt: Date; public readonly createdTimestamp: number; public deleted: boolean; diff --git a/src/lib/extensions/discord.js/BushChannelManager.d.ts b/src/lib/extensions/discord.js/BushChannelManager.d.ts index 1aa19c5..924f5b6 100644 --- a/src/lib/extensions/discord.js/BushChannelManager.d.ts +++ b/src/lib/extensions/discord.js/BushChannelManager.d.ts @@ -1,9 +1,10 @@ import { Snowflake } from 'discord-api-types'; import { CachedManager, Client, FetchChannelOptions } from 'discord.js'; +import { RawChannelData } from 'discord.js/typings/rawDataTypes'; import { BushChannelResolvable } from '../discord-akairo/BushClient'; import { BushChannel } from './BushChannel'; export class BushChannelManager extends CachedManager<Snowflake, BushChannel, BushChannelResolvable> { - public constructor(client: Client, iterable: Iterable<unknown>); + public constructor(client: Client, iterable: Iterable<RawChannelData>); public fetch(id: Snowflake, options?: FetchChannelOptions): Promise<BushChannel | null>; } diff --git a/src/lib/extensions/discord.js/BushClientUser.d.ts b/src/lib/extensions/discord.js/BushClientUser.d.ts index 119f8ce..035c6d9 100644 --- a/src/lib/extensions/discord.js/BushClientUser.d.ts +++ b/src/lib/extensions/discord.js/BushClientUser.d.ts @@ -3,7 +3,7 @@ import { Base64Resolvable, BufferResolvable, ClientUserEditData, - Presence, + Presence as BushPresence, PresenceData, PresenceStatusData } from 'discord.js'; @@ -13,11 +13,11 @@ export class BushClientUser extends BushUser { public mfaEnabled: boolean; public verified: boolean; public edit(data: ClientUserEditData): Promise<this>; - public setActivity(options?: ActivityOptions): Presence; - public setActivity(name: string, options?: ActivityOptions): Presence; - public setAFK(afk: boolean, shardId?: number | number[]): Presence; + public setActivity(options?: ActivityOptions): BushPresence; + public setActivity(name: string, options?: ActivityOptions): BushPresence; + public setAFK(afk: boolean, shardId?: number | number[]): BushPresence; public setAvatar(avatar: BufferResolvable | Base64Resolvable): Promise<this>; - public setPresence(data: PresenceData): Presence; - public setStatus(status: PresenceStatusData, shardId?: number | number[]): Presence; + public setPresence(data: PresenceData): BushPresence; + public setStatus(status: PresenceStatusData, shardId?: number | number[]): BushPresence; public setUsername(username: string): Promise<this>; } diff --git a/src/lib/extensions/discord.js/BushCommandInteraction.ts b/src/lib/extensions/discord.js/BushCommandInteraction.ts index e4fdb53..9e30f79 100644 --- a/src/lib/extensions/discord.js/BushCommandInteraction.ts +++ b/src/lib/extensions/discord.js/BushCommandInteraction.ts @@ -1,15 +1,7 @@ import { APIInteractionGuildMember } from 'discord-api-types/v9'; -import { - ApplicationCommand, - CommandInteraction, - DMChannel, - Invite, - NewsChannel, - PartialDMChannel, - Snowflake, - TextChannel -} from 'discord.js'; -import { BushClient } from '../discord-akairo/BushClient'; +import { ApplicationCommand, CommandInteraction, Invite, Snowflake } from 'discord.js'; +import { RawCommandInteractionData } from 'discord.js/typings/rawDataTypes'; +import { BushClient, BushTextBasedChannels } from '../discord-akairo/BushClient'; import { BushApplicationCommand } from './BushApplicationCommand'; import { BushGuild } from './BushGuild'; import { BushGuildChannel } from './BushGuildChannel'; @@ -28,9 +20,12 @@ export type BushGuildResolvable = | Snowflake; export class BushCommandInteraction extends CommandInteraction { + public constructor(client: BushClient, data: RawCommandInteractionData) { + super(client, data); + } public declare readonly client: BushClient; public declare readonly command: BushApplicationCommand | ApplicationCommand<{ guild: BushGuildResolvable }> | null; - public declare readonly channel: TextChannel | DMChannel | NewsChannel | PartialDMChannel | null; + public declare readonly channel: BushTextBasedChannels | null; public declare readonly guild: BushGuild | null; public declare member: BushGuildMember | APIInteractionGuildMember | null; public declare user: BushUser; diff --git a/src/lib/extensions/discord.js/BushDMChannel.ts b/src/lib/extensions/discord.js/BushDMChannel.ts index 9bf814b..4b44f83 100644 --- a/src/lib/extensions/discord.js/BushDMChannel.ts +++ b/src/lib/extensions/discord.js/BushDMChannel.ts @@ -1,4 +1,5 @@ import { DMChannel } from 'discord.js'; +import { RawDMChannelData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushMessageManager } from './BushMessageManager'; import { BushUser } from './BushUser'; @@ -8,7 +9,7 @@ export class BushDMChannel extends DMChannel { public declare messages: BushMessageManager; public declare recipient: BushUser; - public constructor(client: BushClient, data?: unknown) { + public constructor(client: BushClient, data?: RawDMChannelData) { super(client, data); } } diff --git a/src/lib/extensions/discord.js/BushEmoji.ts b/src/lib/extensions/discord.js/BushEmoji.ts index ba48166..db1cc11 100644 --- a/src/lib/extensions/discord.js/BushEmoji.ts +++ b/src/lib/extensions/discord.js/BushEmoji.ts @@ -1,9 +1,10 @@ import { Emoji } from 'discord.js'; +import { RawEmojiData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; export class BushEmoji extends Emoji { public declare readonly client: BushClient; - public constructor(client: BushClient, emoji: unknown) { + public constructor(client: BushClient, emoji: RawEmojiData) { super(client, emoji); } } diff --git a/src/lib/extensions/discord.js/BushGuild.ts b/src/lib/extensions/discord.js/BushGuild.ts index 9468941..dafa1a4 100644 --- a/src/lib/extensions/discord.js/BushGuild.ts +++ b/src/lib/extensions/discord.js/BushGuild.ts @@ -1,4 +1,5 @@ import { Guild } from 'discord.js'; +import { RawGuildData } from 'discord.js/typings/rawDataTypes'; import { Guild as GuildDB, GuildModel } from '../../models/Guild'; import { ModLogType } from '../../models/ModLog'; import { BushClient, BushUserResolvable } from '../discord-akairo/BushClient'; @@ -10,7 +11,7 @@ export class BushGuild extends Guild { public declare readonly client: BushClient; public declare readonly me: BushGuildMember | null; public declare members: BushGuildMemberManager; - public constructor(client: BushClient, data: unknown) { + public constructor(client: BushClient, data: RawGuildData) { super(client, data); } diff --git a/src/lib/extensions/discord.js/BushGuildApplicationCommandManager.d.ts b/src/lib/extensions/discord.js/BushGuildApplicationCommandManager.d.ts index c0400ce..38afa94 100644 --- a/src/lib/extensions/discord.js/BushGuildApplicationCommandManager.d.ts +++ b/src/lib/extensions/discord.js/BushGuildApplicationCommandManager.d.ts @@ -1,12 +1,13 @@ /* eslint-disable @typescript-eslint/ban-types */ import { ApplicationCommandData, BaseFetchOptions, Collection, Snowflake } from 'discord.js'; +import { RawApplicationCommandData } from 'discord.js/typings/rawDataTypes'; import { BushApplicationCommandResolvable, BushClient } from '../discord-akairo/BushClient'; import { BushApplicationCommand } from './BushApplicationCommand'; import { BushApplicationCommandManager } from './BushApplicationCommandManager'; import { BushGuild } from './BushGuild'; export class BushGuildApplicationCommandManager extends BushApplicationCommandManager<BushApplicationCommand, {}, BushGuild> { - public constructor(guild: BushGuild, iterable?: Iterable<unknown>); + public constructor(guild: BushGuild, iterable?: Iterable<RawApplicationCommandData>); public declare readonly client: BushClient; public guild: BushGuild; public create(command: ApplicationCommandData): Promise<BushApplicationCommand>; diff --git a/src/lib/extensions/discord.js/BushGuildChannel.ts b/src/lib/extensions/discord.js/BushGuildChannel.ts index 7eada41..7daa80d 100644 --- a/src/lib/extensions/discord.js/BushGuildChannel.ts +++ b/src/lib/extensions/discord.js/BushGuildChannel.ts @@ -1,11 +1,12 @@ import { GuildChannel } from 'discord.js'; +import { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushGuild } from './BushGuild'; export class BushGuildChannel extends GuildChannel { public declare readonly client: BushClient; public declare guild: BushGuild; - public constructor(guild: BushGuild, data?: unknown) { - super(guild, data); + public constructor(guild: BushGuild, data?: RawGuildChannelData, client?: BushClient, immediatePatch?: boolean) { + super(guild, data, client, immediatePatch); } } diff --git a/src/lib/extensions/discord.js/BushGuildEmoji.ts b/src/lib/extensions/discord.js/BushGuildEmoji.ts index c03c1b5..0ac5ebd 100644 --- a/src/lib/extensions/discord.js/BushGuildEmoji.ts +++ b/src/lib/extensions/discord.js/BushGuildEmoji.ts @@ -1,4 +1,5 @@ import { GuildEmoji } from 'discord.js'; +import { RawGuildEmojiData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushGuild } from './BushGuild'; import { BushGuildEmojiRoleManager } from './BushGuildEmojiRoleManager'; @@ -9,7 +10,7 @@ export class BushGuildEmoji extends GuildEmoji { public declare guild: BushGuild; public declare author: BushUser | null; public declare readonly roles: BushGuildEmojiRoleManager; - public constructor(client: BushClient, data: unknown, guild: BushGuild) { + public constructor(client: BushClient, data: RawGuildEmojiData, guild: BushGuild) { super(client, data, guild); } } diff --git a/src/lib/extensions/discord.js/BushGuildManager.d.ts b/src/lib/extensions/discord.js/BushGuildManager.d.ts index 5bfe706..4ec9276 100644 --- a/src/lib/extensions/discord.js/BushGuildManager.d.ts +++ b/src/lib/extensions/discord.js/BushGuildManager.d.ts @@ -1,20 +1,13 @@ import { Snowflake } from 'discord-api-types'; -import { - CachedManager, - Collection, - FetchGuildOptions, - FetchGuildsOptions, - Guild, - GuildCreateOptions, - OAuth2Guild -} from 'discord.js'; +import { CachedManager, Collection, FetchGuildOptions, FetchGuildsOptions, GuildCreateOptions, OAuth2Guild } from 'discord.js'; +import { RawGuildData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushGuildResolvable } from './BushCommandInteraction'; import { BushGuild } from './BushGuild'; export class BushGuildManager extends CachedManager<Snowflake, BushGuild, BushGuildResolvable> { - public constructor(client: BushClient, iterable?: Iterable<unknown>); - public create(name: string, options?: GuildCreateOptions): Promise<Guild>; + public constructor(client: BushClient, iterable?: Iterable<RawGuildData>); + public create(name: string, options?: GuildCreateOptions): Promise<BushGuild>; public fetch(options: Snowflake | FetchGuildOptions): Promise<BushGuild>; public fetch(options?: FetchGuildsOptions): Promise<Collection<Snowflake, OAuth2Guild>>; } diff --git a/src/lib/extensions/discord.js/BushGuildMember.ts b/src/lib/extensions/discord.js/BushGuildMember.ts index ec0e323..1606ad6 100644 --- a/src/lib/extensions/discord.js/BushGuildMember.ts +++ b/src/lib/extensions/discord.js/BushGuildMember.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import { GuildMember, Role } from 'discord.js'; +import { RawGuildMemberData } from 'discord.js/typings/rawDataTypes'; import { ModLogType } from '../../models/ModLog'; import { BushClient, BushUserResolvable } from '../discord-akairo/BushClient'; import { BushGuild } from './BushGuild'; @@ -75,7 +76,7 @@ export class BushGuildMember extends GuildMember { public declare readonly client: BushClient; public declare guild: BushGuild; public declare user: BushUser; - public constructor(client: BushClient, data: unknown, guild: BushGuild) { + public constructor(client: BushClient, data: RawGuildMemberData, guild: BushGuild) { super(client, data, guild); } diff --git a/src/lib/extensions/discord.js/BushGuildMemberManager.d.ts b/src/lib/extensions/discord.js/BushGuildMemberManager.d.ts index 7bdad83..b3f2b1b 100644 --- a/src/lib/extensions/discord.js/BushGuildMemberManager.d.ts +++ b/src/lib/extensions/discord.js/BushGuildMemberManager.d.ts @@ -6,35 +6,35 @@ import { Collection, FetchMemberOptions, FetchMembersOptions, - GuildMember, GuildMemberEditData, GuildPruneMembersOptions, GuildSearchMembersOptions, - Snowflake, - User + Snowflake } from 'discord.js'; +import { RawGuildMemberData } from 'discord.js/typings/rawDataTypes'; import { BushClient, BushGuildMemberResolvable, BushUserResolvable } from '../discord-akairo/BushClient'; import { BushGuild } from './BushGuild'; import { BushGuildMember } from './BushGuildMember'; +import { BushUser } from './BushUser'; export class BushGuildMemberManager extends CachedManager<Snowflake, BushGuildMember, BushGuildMemberResolvable> { - public constructor(guild: BushGuild, iterable?: Iterable<unknown>); + public constructor(guild: BushGuild, iterable?: Iterable<RawGuildMemberData>); public declare readonly client: BushClient; public guild: BushGuild; public add( user: BushUserResolvable, options: AddGuildMemberOptions & { fetchWhenExisting: false } - ): Promise<GuildMember | null>; - public add(user: BushUserResolvable, options: AddGuildMemberOptions): Promise<GuildMember>; - public ban(user: BushUserResolvable, options?: BanOptions): Promise<GuildMember | User | Snowflake>; + ): Promise<BushGuildMember | null>; + public add(user: BushUserResolvable, options: AddGuildMemberOptions): Promise<BushGuildMember>; + public ban(user: BushUserResolvable, options?: BanOptions): Promise<BushGuildMember | BushUser | Snowflake>; public edit(user: BushUserResolvable, data: GuildMemberEditData, reason?: string): Promise<void>; public fetch( options: BushUserResolvable | FetchMemberOptions | (FetchMembersOptions & { user: BushUserResolvable }) - ): Promise<GuildMember>; - public fetch(options?: FetchMembersOptions): Promise<Collection<Snowflake, GuildMember>>; - public kick(user: BushUserResolvable, reason?: string): Promise<BushGuildMember | User | Snowflake>; + ): Promise<BushGuildMember>; + public fetch(options?: FetchMembersOptions): Promise<Collection<Snowflake, BushGuildMember>>; + public kick(user: BushUserResolvable, reason?: string): Promise<BushGuildMember | BushUser | Snowflake>; public prune(options: GuildPruneMembersOptions & { dry?: false; count: false }): Promise<null>; public prune(options?: GuildPruneMembersOptions): Promise<number>; - public search(options: GuildSearchMembersOptions): Promise<Collection<Snowflake, GuildMember>>; - public unban(user: BushUserResolvable, reason?: string): Promise<User>; + public search(options: GuildSearchMembersOptions): Promise<Collection<Snowflake, BushGuildMember>>; + public unban(user: BushUserResolvable, reason?: string): Promise<BushUser>; } diff --git a/src/lib/extensions/discord.js/BushMessage.ts b/src/lib/extensions/discord.js/BushMessage.ts index 5638801..921d03e 100644 --- a/src/lib/extensions/discord.js/BushMessage.ts +++ b/src/lib/extensions/discord.js/BushMessage.ts @@ -1,29 +1,23 @@ /* eslint-disable @typescript-eslint/no-empty-interface */ import { Message, Partialize } from 'discord.js'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushDMChannel } from './BushDMChannel'; +import { RawMessageData } from 'discord.js/typings/rawDataTypes'; +import { BushClient, BushTextBasedChannels } from '../discord-akairo/BushClient'; +import { BushCommandUtil } from '../discord-akairo/BushCommandUtil'; import { BushGuild } from './BushGuild'; import { BushGuildMember } from './BushGuildMember'; -import { BushNewsChannel } from './BushNewsChannel'; -import { BushTextChannel } from './BushTextChannel'; -import { BushThreadChannel } from './BushThreadChannel'; import { BushUser } from './BushUser'; export interface BushPartialMessage extends Partialize<BushMessage, 'type' | 'system' | 'pinned' | 'tts', 'content' | 'cleanContent' | 'author'> {} export class BushMessage extends Message { public declare readonly client: BushClient; - // public util: BushCommandUtil; + public override util: BushCommandUtil; public declare readonly guild: BushGuild | null; public declare readonly member: BushGuildMember | null; public declare author: BushUser; - public declare channel: BushTextChannel | BushDMChannel | BushNewsChannel | BushThreadChannel; - public constructor( - client: BushClient, - data: unknown, - channel: BushTextChannel | BushDMChannel | BushNewsChannel | BushThreadChannel - ) { - super(client, data, channel); + public declare readonly channel: BushTextBasedChannels; + public constructor(client: BushClient, data: RawMessageData) { + super(client, data); // this.util = new BushCommandUtil(client.commandHandler, this); } public override fetch(force?: boolean): Promise<BushMessage> { diff --git a/src/lib/extensions/discord.js/BushMessageManager.d.ts b/src/lib/extensions/discord.js/BushMessageManager.d.ts index bf795ad..8495130 100644 --- a/src/lib/extensions/discord.js/BushMessageManager.d.ts +++ b/src/lib/extensions/discord.js/BushMessageManager.d.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import { BaseFetchOptions, CachedManager, @@ -7,23 +6,20 @@ import { EmojiIdentifierResolvable, MessageEditOptions, MessagePayload, - Snowflake, - TextBasedChannelFields + MessageResolvable, + Snowflake } from 'discord.js'; -import { BushClient, BushMessageResolvable } from '../discord-akairo/BushClient'; -import { BushDMChannel } from './BushDMChannel'; +import { RawMessageData } from 'discord.js/typings/rawDataTypes'; +import { BushMessageResolvable, BushTextBasedChannels } from '../..'; import { BushMessage } from './BushMessage'; -import { BushTextChannel } from './BushTextChannel'; -import { BushThreadChannel } from './BushThreadChannel'; export class BushMessageManager extends CachedManager<Snowflake, BushMessage, BushMessageResolvable> { - public constructor(channel: BushTextChannel | BushDMChannel | BushThreadChannel, iterable?: Iterable<unknown>); - public declare readonly client: BushClient; - public channel: TextBasedChannelFields; + public constructor(channel: BushTextBasedChannels, iterable?: Iterable<RawMessageData>); + public channel: BushTextBasedChannels; public cache: Collection<Snowflake, BushMessage>; public crosspost(message: BushMessageResolvable): Promise<BushMessage>; public delete(message: BushMessageResolvable): Promise<void>; - public edit(message: BushMessageResolvable, options: MessagePayload | MessageEditOptions): Promise<BushMessage>; + public edit(message: MessageResolvable, options: MessagePayload | MessageEditOptions): Promise<BushMessage>; public fetch(message: Snowflake, options?: BaseFetchOptions): Promise<BushMessage>; public fetch(options?: ChannelLogsQueryOptions, cacheOptions?: BaseFetchOptions): Promise<Collection<Snowflake, BushMessage>>; public fetchPinned(cache?: boolean): Promise<Collection<Snowflake, BushMessage>>; diff --git a/src/lib/extensions/discord.js/BushMessageReaction.ts b/src/lib/extensions/discord.js/BushMessageReaction.ts index c57aafa..b0bc5d7 100644 --- a/src/lib/extensions/discord.js/BushMessageReaction.ts +++ b/src/lib/extensions/discord.js/BushMessageReaction.ts @@ -1,4 +1,5 @@ import { MessageReaction } from 'discord.js'; +import { RawMessageReactionData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushGuildEmoji } from './BushGuildEmoji'; import { BushMessage } from './BushMessage'; @@ -8,7 +9,7 @@ export class BushMessageReaction extends MessageReaction { public declare readonly client: BushClient; public declare readonly emoji: BushGuildEmoji | BushReactionEmoji; - public constructor(client: BushClient, data: unknown, message: BushMessage) { + public constructor(client: BushClient, data: RawMessageReactionData, message: BushMessage) { super(client, data, message); } } diff --git a/src/lib/extensions/discord.js/BushNewsChannel.ts b/src/lib/extensions/discord.js/BushNewsChannel.ts index 9682632..f44ff4a 100644 --- a/src/lib/extensions/discord.js/BushNewsChannel.ts +++ b/src/lib/extensions/discord.js/BushNewsChannel.ts @@ -1,6 +1,7 @@ -import { AllowedThreadTypeForNewsChannel, NewsChannel } from 'discord.js'; +import { AllowedThreadTypeForTextChannel, Collection, NewsChannel, Snowflake } from 'discord.js'; import { BushClient } from '../discord-akairo/BushClient'; import { BushGuild } from './BushGuild'; +import { BushGuildMember } from './BushGuildMember'; import { BushMessageManager } from './BushMessageManager'; import { BushThreadManager } from './BushThreadManager'; @@ -8,9 +9,6 @@ export class BushNewsChannel extends NewsChannel { public declare readonly client: BushClient; public declare guild: BushGuild; public declare messages: BushMessageManager; - public declare threads: BushThreadManager<AllowedThreadTypeForNewsChannel>; - // eslint-disable-next-line @typescript-eslint/ban-types - public constructor(guild: BushGuild, data?: object) { - super(guild, data); - } + public declare members: Collection<Snowflake, BushGuildMember>; + public declare threads: BushThreadManager<AllowedThreadTypeForTextChannel>; } diff --git a/src/lib/extensions/discord.js/BushPresence.ts b/src/lib/extensions/discord.js/BushPresence.ts index 13c7567..ff1937c 100644 --- a/src/lib/extensions/discord.js/BushPresence.ts +++ b/src/lib/extensions/discord.js/BushPresence.ts @@ -1,4 +1,5 @@ import { Presence } from 'discord.js'; +import { RawPresenceData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushGuild } from './BushGuild'; import { BushGuildMember } from './BushGuildMember'; @@ -9,7 +10,7 @@ export class BushPresence extends Presence { public declare readonly member: BushGuildMember | null; public declare readonly user: BushUser | null; - public constructor(client: BushClient, data?: unknown) { + public constructor(client: BushClient, data?: RawPresenceData) { super(client, data); } } diff --git a/src/lib/extensions/discord.js/BushReactionEmoji.ts b/src/lib/extensions/discord.js/BushReactionEmoji.ts index a25c1b8..3aee2fb 100644 --- a/src/lib/extensions/discord.js/BushReactionEmoji.ts +++ b/src/lib/extensions/discord.js/BushReactionEmoji.ts @@ -1,11 +1,12 @@ import { ReactionEmoji } from 'discord.js'; +import { RawReactionEmojiData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushMessageReaction } from './BushMessageReaction'; export class BushReactionEmoji extends ReactionEmoji { public declare readonly client: BushClient; public declare reaction: BushMessageReaction; - public constructor(reaction: BushMessageReaction, emoji: unknown) { + public constructor(reaction: BushMessageReaction, emoji: RawReactionEmojiData) { super(reaction, emoji); } } diff --git a/src/lib/extensions/discord.js/BushRole.ts b/src/lib/extensions/discord.js/BushRole.ts index 57533c9..084b019 100644 --- a/src/lib/extensions/discord.js/BushRole.ts +++ b/src/lib/extensions/discord.js/BushRole.ts @@ -1,4 +1,5 @@ import { Collection, Role, Snowflake } from 'discord.js'; +import { RawRoleData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushGuild } from './BushGuild'; import { BushGuildMember } from './BushGuildMember'; @@ -7,7 +8,7 @@ export class BushRole extends Role { public declare readonly client: BushClient; public declare guild: BushGuild; public declare readonly members: Collection<Snowflake, BushGuildMember>; - public constructor(client: BushClient, data: unknown, guild: BushGuild) { + public constructor(client: BushClient, data: RawRoleData, guild: BushGuild) { super(client, data, guild); } } diff --git a/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts b/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts index 18db8ef..a16d8c2 100644 --- a/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts +++ b/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts @@ -1,19 +1,17 @@ import { APIInteractionGuildMember } from 'discord-api-types/v9'; -import { PartialDMChannel, SelectMenuInteraction } from 'discord.js'; -import { BushClient } from '../discord-akairo/BushClient'; -import { BushDMChannel } from './BushDMChannel'; +import { SelectMenuInteraction } from 'discord.js'; +import { RawMessageSelectMenuInteractionData } from 'discord.js/typings/rawDataTypes'; +import { BushClient, BushTextBasedChannels } from '../discord-akairo/BushClient'; import { BushGuild } from './BushGuild'; import { BushGuildMember } from './BushGuildMember'; -import { BushNewsChannel } from './BushNewsChannel'; -import { BushTextChannel } from './BushTextChannel'; import { BushUser } from './BushUser'; export class BushSelectMenuInteraction extends SelectMenuInteraction { - public declare readonly channel: BushTextChannel | BushDMChannel | BushNewsChannel | PartialDMChannel | null; + public declare readonly channel: BushTextBasedChannels | null; public declare readonly guild: BushGuild | null; public declare member: BushGuildMember | APIInteractionGuildMember | null; public declare user: BushUser; - public constructor(client: BushClient, data: unknown) { + public constructor(client: BushClient, data: RawMessageSelectMenuInteractionData) { super(client, data); } } diff --git a/src/lib/extensions/discord.js/BushStageChannel.ts b/src/lib/extensions/discord.js/BushStageChannel.ts index 5bd3f45..4df64e8 100644 --- a/src/lib/extensions/discord.js/BushStageChannel.ts +++ b/src/lib/extensions/discord.js/BushStageChannel.ts @@ -1,4 +1,5 @@ import { Collection, Snowflake, StageChannel } from 'discord.js'; +import { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushCategoryChannel } from './BushCategoryChannel'; import { BushGuild } from './BushGuild'; @@ -11,7 +12,7 @@ export class BushStageChannel extends StageChannel { public declare readonly members: Collection<Snowflake, BushGuildMember>; public declare guild: BushGuild; public declare readonly parent: BushCategoryChannel | null; - public constructor(guild: BushGuild, data?: unknown) { + public constructor(guild: BushGuild, data?: RawGuildChannelData) { super(guild, data); } } diff --git a/src/lib/extensions/discord.js/BushStageInstance.ts b/src/lib/extensions/discord.js/BushStageInstance.ts index f162d33..ab09863 100644 --- a/src/lib/extensions/discord.js/BushStageInstance.ts +++ b/src/lib/extensions/discord.js/BushStageInstance.ts @@ -1,4 +1,5 @@ import { StageInstance } from 'discord.js'; +import { RawStageInstanceData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushGuild } from './BushGuild'; import { BushStageChannel } from './BushStageChannel'; @@ -7,7 +8,7 @@ export class BushStageInstance extends StageInstance { public declare readonly client: BushClient; public declare readonly channel: BushStageChannel | null; public declare readonly guild: BushGuild | null; - public constructor(client: BushClient, data: unknown, channel: BushStageChannel) { + public constructor(client: BushClient, data: RawStageInstanceData, channel: BushStageChannel) { super(client, data, channel); } } diff --git a/src/lib/extensions/discord.js/BushStoreChannel.ts b/src/lib/extensions/discord.js/BushStoreChannel.ts index 8ce22c0..20bfeab 100644 --- a/src/lib/extensions/discord.js/BushStoreChannel.ts +++ b/src/lib/extensions/discord.js/BushStoreChannel.ts @@ -1,4 +1,5 @@ import { Collection, Snowflake, StoreChannel } from 'discord.js'; +import { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushCategoryChannel } from './BushCategoryChannel'; import { BushGuild } from './BushGuild'; @@ -10,7 +11,7 @@ export class BushStoreChannel extends StoreChannel { public declare readonly members: Collection<Snowflake, BushGuildMember>; public declare readonly parent: BushCategoryChannel | null; - public constructor(guild: BushGuild, data?: unknown) { - super(guild, data); + public constructor(guild: BushGuild, data?: RawGuildChannelData, client?: BushClient) { + super(guild, data, client); } } diff --git a/src/lib/extensions/discord.js/BushTextChannel.ts b/src/lib/extensions/discord.js/BushTextChannel.ts index 26e3858..db3ad8f 100644 --- a/src/lib/extensions/discord.js/BushTextChannel.ts +++ b/src/lib/extensions/discord.js/BushTextChannel.ts @@ -1,4 +1,5 @@ import { TextChannel } from 'discord.js'; +import { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushGuild } from './BushGuild'; import { BushMessageManager } from './BushMessageManager'; @@ -7,7 +8,7 @@ export class BushTextChannel extends TextChannel { public declare readonly client: BushClient; public declare guild: BushGuild; public declare messages: BushMessageManager; - public constructor(guild: BushGuild, data?: unknown) { + public constructor(guild: BushGuild, data?: RawGuildChannelData) { super(guild, data); } } diff --git a/src/lib/extensions/discord.js/BushThreadChannel.ts b/src/lib/extensions/discord.js/BushThreadChannel.ts index 455939d..b78aff7 100644 --- a/src/lib/extensions/discord.js/BushThreadChannel.ts +++ b/src/lib/extensions/discord.js/BushThreadChannel.ts @@ -1,6 +1,5 @@ -/* eslint-disable @typescript-eslint/ban-types */ - import { Collection, Snowflake, ThreadChannel } from 'discord.js'; +import { RawThreadChannelData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushGuild } from './BushGuild'; import { BushGuildMember } from './BushGuildMember'; @@ -13,12 +12,10 @@ export class BushThreadChannel extends ThreadChannel { public declare guild: BushGuild; public declare messages: BushMessageManager; public declare members: BushThreadMemberManager; - public declare readonly client: BushClient; public declare readonly guildMembers: Collection<Snowflake, BushGuildMember>; - public declare readonly parent: BushTextChannel | BushNewsChannel | null; - public constructor(guild: BushGuild, data?: object) { - super(guild, data); + public constructor(guild: BushGuild, data?: RawThreadChannelData, client?: BushClient, fromInteraction?: boolean) { + super(guild, data, client, fromInteraction); } } diff --git a/src/lib/extensions/discord.js/BushThreadManager.d.ts b/src/lib/extensions/discord.js/BushThreadManager.d.ts index 6b8250b..027d532 100644 --- a/src/lib/extensions/discord.js/BushThreadManager.d.ts +++ b/src/lib/extensions/discord.js/BushThreadManager.d.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import { BaseFetchOptions, CachedManager, @@ -8,13 +7,14 @@ import { ThreadChannelResolvable, ThreadCreateOptions } from 'discord.js'; +import { RawThreadChannelData } from 'discord.js/typings/rawDataTypes'; import { BushClient, BushFetchedThreads, BushThreadChannelResolvable } from '../discord-akairo/BushClient'; import { BushNewsChannel } from './BushNewsChannel'; import { BushTextChannel } from './BushTextChannel'; import { BushThreadChannel } from './BushThreadChannel'; export class BushThreadManager<AllowedThreadType> extends CachedManager<Snowflake, BushThreadChannel, ThreadChannelResolvable> { - public constructor(channel: BushTextChannel | BushNewsChannel, iterable?: Iterable<unknown>); + public constructor(channel: BushTextChannel | BushNewsChannel, iterable?: Iterable<RawThreadChannelData>); public declare readonly client: BushClient; public channel: BushTextChannel | BushNewsChannel; public create(options: ThreadCreateOptions<AllowedThreadType>): Promise<BushThreadChannel>; diff --git a/src/lib/extensions/discord.js/BushThreadMember.ts b/src/lib/extensions/discord.js/BushThreadMember.ts index 4ef51ae..77f2b20 100644 --- a/src/lib/extensions/discord.js/BushThreadMember.ts +++ b/src/lib/extensions/discord.js/BushThreadMember.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/ban-types */ import { ThreadMember } from 'discord.js'; +import { RawThreadMemberData } from 'discord.js/typings/rawDataTypes'; import { BushGuildMember } from './BushGuildMember'; import { BushThreadChannel } from './BushThreadChannel'; import { BushUser } from './BushUser'; @@ -8,7 +9,7 @@ export class BushThreadMember extends ThreadMember { public declare readonly guildMember: BushGuildMember | null; public declare readonly user: BushUser | null; public declare thread: BushThreadChannel; - public constructor(thread: BushThreadChannel, data?: object) { + public constructor(thread: BushThreadChannel, data?: RawThreadMemberData) { super(thread, data); } } diff --git a/src/lib/extensions/discord.js/BushThreadMemberManager.d.ts b/src/lib/extensions/discord.js/BushThreadMemberManager.d.ts index ba9b90b..cbc28de 100644 --- a/src/lib/extensions/discord.js/BushThreadMemberManager.d.ts +++ b/src/lib/extensions/discord.js/BushThreadMemberManager.d.ts @@ -1,12 +1,11 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/no-empty-interface */ import { CachedManager, Collection, Snowflake, ThreadChannel, ThreadMember, UserResolvable } from 'discord.js'; +import { RawThreadMemberData } from 'discord.js/typings/rawDataTypes'; import { BushClient, BushThreadMemberResolvable } from '../discord-akairo/BushClient'; import { BushThreadChannel } from './BushThreadChannel'; import { BushThreadMember } from './BushThreadMember'; export class BushThreadMemberManager extends CachedManager<Snowflake, BushThreadMember, BushThreadMemberResolvable> { - public constructor(thread: BushThreadChannel, iterable?: Iterable<unknown>); + public constructor(thread: BushThreadChannel, iterable?: Iterable<RawThreadMemberData>); public declare readonly client: BushClient; public thread: ThreadChannel; public add(member: UserResolvable | '@me', reason?: string): Promise<Snowflake>; diff --git a/src/lib/extensions/discord.js/BushUser.ts b/src/lib/extensions/discord.js/BushUser.ts index 54a67b5..9a183e1 100644 --- a/src/lib/extensions/discord.js/BushUser.ts +++ b/src/lib/extensions/discord.js/BushUser.ts @@ -1,11 +1,12 @@ import { User } from 'discord.js'; +import { RawUserData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushDMChannel } from './BushDMChannel'; export class BushUser extends User { public declare readonly client: BushClient; public declare readonly dmChannel: BushDMChannel | null; - public constructor(client: BushClient, data: unknown) { + public constructor(client: BushClient, data: RawUserData) { super(client, data); } diff --git a/src/lib/extensions/discord.js/BushUserManager.d.ts b/src/lib/extensions/discord.js/BushUserManager.d.ts index 176b449..49fc680 100644 --- a/src/lib/extensions/discord.js/BushUserManager.d.ts +++ b/src/lib/extensions/discord.js/BushUserManager.d.ts @@ -1,9 +1,10 @@ import { Snowflake } from 'discord-api-types'; import { BaseFetchOptions, CachedManager } from 'discord.js'; +import { RawUserData } from 'discord.js/typings/rawDataTypes'; import { BushClient, BushUserResolvable } from '../discord-akairo/BushClient'; import { BushUser } from './BushUser'; export class BushUserManager extends CachedManager<Snowflake, BushUser, BushUserResolvable> { - public constructor(client: BushClient, iterable?: Iterable<unknown>); + public constructor(client: BushClient, iterable?: Iterable<RawUserData>); public fetch(id: Snowflake, options?: BaseFetchOptions): Promise<BushUser>; } diff --git a/src/lib/extensions/discord.js/BushVoiceChannel.ts b/src/lib/extensions/discord.js/BushVoiceChannel.ts index 82a68b1..ab0da15 100644 --- a/src/lib/extensions/discord.js/BushVoiceChannel.ts +++ b/src/lib/extensions/discord.js/BushVoiceChannel.ts @@ -1,4 +1,5 @@ import { Collection, Snowflake, VoiceChannel } from 'discord.js'; +import { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; import { BushClient } from '../discord-akairo/BushClient'; import { BushGuild } from './BushGuild'; import { BushGuildMember } from './BushGuildMember'; @@ -6,7 +7,7 @@ import { BushGuildMember } from './BushGuildMember'; export class BushVoiceChannel extends VoiceChannel { public declare readonly client: BushClient; public declare readonly members: Collection<Snowflake, BushGuildMember>; - public constructor(guild: BushGuild, data?: unknown) { + public constructor(guild: BushGuild, data?: RawGuildChannelData) { super(guild, data); } } diff --git a/src/lib/extensions/discord.js/BushVoiceState.ts b/src/lib/extensions/discord.js/BushVoiceState.ts index 416b0d8..d9570ad 100644 --- a/src/lib/extensions/discord.js/BushVoiceState.ts +++ b/src/lib/extensions/discord.js/BushVoiceState.ts @@ -1,4 +1,5 @@ import { VoiceState } from 'discord.js'; +import { RawVoiceStateData } from 'discord.js/typings/rawDataTypes'; import { BushGuild } from './BushGuild'; import { BushGuildMember } from './BushGuildMember'; import { BushStageChannel } from './BushStageChannel'; @@ -8,7 +9,7 @@ export class BushVoiceState extends VoiceState { public declare readonly channel: BushVoiceChannel | BushStageChannel | null; public declare guild: BushGuild; public declare readonly member: BushGuildMember | null; - public constructor(guild: BushGuild, data: unknown) { + public constructor(guild: BushGuild, data: RawVoiceStateData) { super(guild, data); } } @@ -809,7 +809,7 @@ __metadata: common-tags: ^1.8.0 discord-akairo: NotEnoughUpdates/discord-akairo discord-akairo-message-util: NotEnoughUpdates/discord-akairo-message-util - discord-api-types: 0.21.0 + discord-api-types: 0.22.0 discord.js: NotEnoughUpdates/discord.js discord.js-minesweeper: ^1.0.6 esbuild: ^0.12.11 @@ -831,11 +831,6 @@ __metadata: tinycolor2: ^1.4.2 typescript: ^4.3.5 uuid: ^8.3.2 - dependenciesMeta: - discord-akairo-message-util@1.0.0: - unplugged: true - discord-akairo@8.2.2: - unplugged: true languageName: unknown linkType: soft @@ -1344,24 +1339,24 @@ __metadata: discord-akairo-message-util@NotEnoughUpdates/discord-akairo-message-util: version: 1.0.0 - resolution: "discord-akairo-message-util@https://github.com/NotEnoughUpdates/discord-akairo-message-util.git#commit=0c3338058b32ee5cb5b410a148fbcb70c9ba8fde" - checksum: bd6bbd7e1a1afdda652de26d168c0df33083571992651ea3e7b96f573524b6d6ac977bec7c245c086cccebe62b8fd190954ad95253721fccbdfcb4deb39e64cb + resolution: "discord-akairo-message-util@https://github.com/NotEnoughUpdates/discord-akairo-message-util.git#commit=9831d4f340bc8c3452d3dfef0497f7844dee0f29" + checksum: 037722daf405eb7afebc47423e29a54816f5ab245e4aa0b0f99ad4ed32980839e1d1a399c12310acb1cabd6890d929d870223bddba4b6c2d107b5a79c4a37108 languageName: node linkType: hard discord-akairo@NotEnoughUpdates/discord-akairo: version: 8.2.2 - resolution: "discord-akairo@https://github.com/NotEnoughUpdates/discord-akairo.git#commit=9a48bd17f3d88fcadbdd667b6b543ae16bc390c2" + resolution: "discord-akairo@https://github.com/NotEnoughUpdates/discord-akairo.git#commit=666f0cceda2956dd818e5db87e78938cbbeb52bb" dependencies: discord-akairo-message-util: NotEnoughUpdates/discord-akairo-message-util - checksum: 2dddf0d1717b3f4ecaa0d9fba1489a3c0227b4cad13207bc586b2b83c2d8e3a633ad2cdb1d36edde261bf010eb68b450f3524ad8ee9e52a198e1645a2282168e + checksum: f751769cd162f2c8500adad99d8149790825d239a4dc7e07a04b09f34916827b6cea7957a7f3dc84caf858410611bc21589d0c57744371b17c3c78f2c3328277 languageName: node linkType: hard -"discord-api-types@npm:0.21.0": - version: 0.21.0 - resolution: "discord-api-types@npm:0.21.0" - checksum: 00872f1c453964d86579e59a6aa57fc7b2025b84bf7168fb4dad1d8e218db09dc78c20758ef9e15135bbfc76c9bf51102e671c0a20530e552ad7fc6f93a971c3 +"discord-api-types@npm:0.22.0, discord-api-types@npm:^0.22.0": + version: 0.22.0 + resolution: "discord-api-types@npm:0.22.0" + checksum: 673bcd960e394d8a3752bb03d50de44e74d508450e3d2cce947a69e0a6dc43c00196e18245c88dd26f3a8b0a56b40e0dbf52e058b7aabc7ed77f0f018003cb04 languageName: node linkType: hard @@ -1372,13 +1367,6 @@ discord-akairo@NotEnoughUpdates/discord-akairo: languageName: node linkType: hard -"discord-api-types@npm:^0.22.0": - version: 0.22.0 - resolution: "discord-api-types@npm:0.22.0" - checksum: 673bcd960e394d8a3752bb03d50de44e74d508450e3d2cce947a69e0a6dc43c00196e18245c88dd26f3a8b0a56b40e0dbf52e058b7aabc7ed77f0f018003cb04 - languageName: node - linkType: hard - "discord.js-minesweeper@npm:^1.0.6": version: 1.0.6 resolution: "discord.js-minesweeper@npm:1.0.6" @@ -1388,7 +1376,7 @@ discord-akairo@NotEnoughUpdates/discord-akairo: discord.js@NotEnoughUpdates/discord.js: version: 13.0.0-dev - resolution: "discord.js@https://github.com/NotEnoughUpdates/discord.js.git#commit=d118277c618fdb08a15b90e3d342e5651befdee1" + resolution: "discord.js@https://github.com/NotEnoughUpdates/discord.js.git#commit=2fec427c7f5052e510e3a5684a45a53489570fed" dependencies: "@discordjs/builders": ^0.3.0 "@discordjs/collection": ^0.2.1 @@ -1399,7 +1387,7 @@ discord.js@NotEnoughUpdates/discord.js: discord-api-types: ^0.22.0 node-fetch: ^2.6.1 ws: ^7.5.1 - checksum: f854feb2ac0cdbf4171d593171b05d7a23a7fdab1d3f94cf20bf8dde1e97468da312c7152cd965910fd1c330d58de5d2943a6007ea482f4fa6ea0778d1a0aaf2 + checksum: 4353fb22b30db5c7f709cb8c4c11c25cd960d0975a4530988e806ecf1c2fdfa014ed8e3f8e88f001de7959fb222a9e18e90c958f82b7b3e1007e6c4bb5969a12 languageName: node linkType: hard @@ -1494,11 +1482,11 @@ discord.js@NotEnoughUpdates/discord.js: linkType: hard "esbuild@npm:^0.12.11": - version: 0.12.17 - resolution: "esbuild@npm:0.12.17" + version: 0.12.18 + resolution: "esbuild@npm:0.12.18" bin: esbuild: bin/esbuild - checksum: 9c0c230470a1daa7e1e623bbbf24c8d15187406b862a82258a7df2c3db59bc1f04b5889b50ac940b7b2b3c43dac13e675181a60e828fc39c0288f5c6ccccfec0 + checksum: 956fefaf685c953dd49b5e271c21d76c158ff7f745a2a3a90fff145464285bcaeab72ad4f23c8938e7e730f5fad8fcab00fb81e6b1ef63ee89a5d06ed38ae894 languageName: node linkType: hard @@ -1982,9 +1970,9 @@ discord.js@NotEnoughUpdates/discord.js: linkType: hard "graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6": - version: 4.2.6 - resolution: "graceful-fs@npm:4.2.6" - checksum: 792e64aafda05a151289f83eaa16aff34ef259658cefd65393883d959409f5a2389b0ec9ebf28f3d21f1b0ddc8f594a1162ae9b18e2b507a6799a70706ec573d + version: 4.2.8 + resolution: "graceful-fs@npm:4.2.8" + checksum: 5d224c8969ad0581d551dfabdb06882706b31af2561bd5e2034b4097e67cc27d05232849b8643866585fd0a41c7af152950f8776f4dd5579e9853733f31461c6 languageName: node linkType: hard @@ -4075,9 +4063,9 @@ resolve@^1.19.0: linkType: hard "type-fest@npm:^1.2.1": - version: 1.3.0 - resolution: "type-fest@npm:1.3.0" - checksum: c5f897c8d88ddf2f3f14743d7af6d1ce62aa957c6540349ef2e0444839dc26a81c1a41309d115d1cfa1f1c5e0a3a84f0798ee3312b6bdedef2c2c4e9448c4ea0 + version: 1.4.0 + resolution: "type-fest@npm:1.4.0" + checksum: b011c3388665b097ae6a109a437a04d6f61d81b7357f74cbcb02246f2f5bd72b888ae33631b99871388122ba0a87f4ff1c94078e7119ff22c70e52c0ff828201 languageName: node linkType: hard |