diff --git a/packages/i18next/src/lib/functions.ts b/packages/i18next/src/lib/functions.ts index 73fb9e34..3404baa7 100644 --- a/packages/i18next/src/lib/functions.ts +++ b/packages/i18next/src/lib/functions.ts @@ -1,15 +1,6 @@ import { container } from '@sapphire/pieces'; import { lazy, type NonNullObject } from '@sapphire/utilities'; -import { - ChannelType, - CommandInteraction, - Guild, - Locale, - Message, - MessageComponentInteraction, - type APIApplicationCommandOptionChoice, - type LocaleString -} from 'discord.js'; +import { BaseInteraction, ChannelType, Guild, Locale, Message, type APIApplicationCommandOptionChoice, type LocaleString } from 'discord.js'; import type { TFuncKey, TOptions } from 'i18next'; import type { BuilderWithDescription, @@ -37,7 +28,7 @@ import type { */ export function fetchLanguage(target: Target): Promise { // Handle Interactions: - if (target instanceof CommandInteraction || target instanceof MessageComponentInteraction) { + if (target instanceof BaseInteraction) { return resolveLanguage({ user: target.user, channel: target.channel, diff --git a/packages/i18next/src/lib/types.ts b/packages/i18next/src/lib/types.ts index 9ef42be9..2306668c 100644 --- a/packages/i18next/src/lib/types.ts +++ b/packages/i18next/src/lib/types.ts @@ -1,17 +1,7 @@ import type { Awaitable } from '@sapphire/utilities'; import type { Backend } from '@skyra/i18next-backend'; import type { WatchOptions } from 'chokidar'; -import type { - CommandInteraction, - Guild, - Interaction, - LocalizationMap, - Message, - MessageComponentInteraction, - StageChannel, - User, - VoiceChannel -} from 'discord.js'; +import type { BaseInteraction, Guild, Interaction, LocalizationMap, Message, StageChannel, User, VoiceChannel } from 'discord.js'; import type { DefaultTFuncReturnWithObject, InitOptions, Namespace, TFuncKey, TFuncReturn, TypeOptions } from 'i18next'; export interface StringMap { @@ -179,4 +169,4 @@ export interface BuilderWithDescription { export type BuilderWithNameAndDescription = BuilderWithName & BuilderWithDescription; export type ChannelTarget = Message | DiscordChannel; -export type Target = CommandInteraction | ChannelTarget | Guild | MessageComponentInteraction; +export type Target = BaseInteraction | ChannelTarget | Guild;