diff --git a/src/typings/Autocomplete.ts b/src/typings/Autocomplete.ts deleted file mode 100644 index 5023a5a..0000000 --- a/src/typings/Autocomplete.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AutocompleteInteraction } from "discord.js" -import { ExtendedClient } from "~/utils/Client" - -export interface IAutocomplete { - name: string - description: string - execute: (arg: { interaction: AutocompleteInteraction, client: ExtendedClient }) => Promise -} diff --git a/src/typings/Button.ts b/src/typings/Button.ts deleted file mode 100644 index d013d16..0000000 --- a/src/typings/Button.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ButtonInteraction } from "discord.js" -import { ExtendedClient } from "~/utils/Client" - -export interface IButton { - name: string - description: string - execute: (arg: { interaction: ButtonInteraction, client: ExtendedClient }) => Promise -} diff --git a/src/typings/Command.ts b/src/typings/Command.ts deleted file mode 100644 index a94909e..0000000 --- a/src/typings/Command.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js" -import { ExtendedClient as Client } from "~/utils/Client" - -export interface ICommand { - name: string - description: string - dev?: boolean - public: boolean - subcommands?: boolean - data: SlashCommandBuilder - execute: (arg: { interaction: ChatInputCommandInteraction, client: Client }) => Promise -} diff --git a/src/typings/ContextMenu.ts b/src/typings/ContextMenu.ts deleted file mode 100644 index f9e1c10..0000000 --- a/src/typings/ContextMenu.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ContextMenuCommandBuilder, ContextMenuCommandInteraction } from "discord.js" -import { ExtendedClient } from "~/utils/Client" - -export interface IContextMenu { - name: string - description: string - dev?: boolean - data: ContextMenuCommandBuilder - execute: (arg: { interaction: ContextMenuCommandInteraction, client: ExtendedClient }) => Promise -} diff --git a/src/typings/Discord.ts b/src/typings/Discord.ts new file mode 100644 index 0000000..07ba8d6 --- /dev/null +++ b/src/typings/Discord.ts @@ -0,0 +1,55 @@ +import { + AutocompleteInteraction, + ButtonInteraction, + ChatInputCommandInteraction, + ClientEvents, + ContextMenuCommandBuilder, + ContextMenuCommandInteraction, + ModalSubmitInteraction, + SlashCommandBuilder +} from "discord.js" +import { ExtendedClient } from "~/utils/Client" + +export interface ICommand { + name: string + description: string + dev?: boolean + public: boolean + subcommands?: boolean + data: SlashCommandBuilder + execute: (arg: { interaction: ChatInputCommandInteraction, client: ExtendedClient }) => Promise +} +export interface IContextMenu { + name: string + description: string + dev?: boolean + data: ContextMenuCommandBuilder + execute: (arg: { interaction: ContextMenuCommandInteraction, client: ExtendedClient }) => Promise +} +export type SubCommand = ( + arg: T extends true ? { + interaction: ChatInputCommandInteraction + client: ExtendedClient + } : + { + interaction: ChatInputCommandInteraction + } +) => Promise + +export interface IAutocomplete { + name: string + description: string + execute: (arg: { interaction: AutocompleteInteraction, client: ExtendedClient }) => Promise +} +export interface IButton { + name: string + description: string + execute: (arg: { interaction: ButtonInteraction, client: ExtendedClient }) => Promise +} +export interface IModal { + name: string + description: string + execute: (arg: { interaction: ModalSubmitInteraction, client: ExtendedClient }) => Promise +} + +export type Event = (...args: ClientEvents[E]) => void diff --git a/src/typings/Event.ts b/src/typings/Event.ts deleted file mode 100644 index 6745b54..0000000 --- a/src/typings/Event.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ClientEvents } from "discord.js" - -export type Event = (...args: ClientEvents[E]) => void diff --git a/src/typings/Modal.ts b/src/typings/Modal.ts deleted file mode 100644 index aefd302..0000000 --- a/src/typings/Modal.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ModalSubmitInteraction } from "discord.js" -import { ExtendedClient } from "~/utils/Client" - -export interface IModal { - name: string - description: string - execute: (arg: { interaction: ModalSubmitInteraction, client: ExtendedClient }) => Promise -} diff --git a/src/typings/SubCommand.ts b/src/typings/SubCommand.ts deleted file mode 100644 index 4a37636..0000000 --- a/src/typings/SubCommand.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { ChatInputCommandInteraction } from "discord.js" -import { ExtendedClient } from "~/utils/Client" - -type InteractionObject = { - interaction: ChatInputCommandInteraction -} - -type ClientObject = { - client: ExtendedClient -} - -type SubCommandObject = T extends true ? InteractionObject & ClientObject : InteractionObject - -export type SubCommand = (arg: SubCommandObject) => Promise diff --git a/src/typings/TimeZones.ts b/src/typings/TimeZones.ts index 04598c9..9b0a90c 100644 --- a/src/typings/TimeZones.ts +++ b/src/typings/TimeZones.ts @@ -1,4 +1,4 @@ -type TimeZonesArray = [ +export type TimeZones = [ "Africa/Abidjan", "Africa/Accra", "Africa/Addis_Ababa", @@ -427,6 +427,4 @@ type TimeZonesArray = [ "Pacific/Truk", "Pacific/Wake", "Pacific/Wallis" -] - -export type TimeZones = TimeZonesArray[number] +][number] diff --git a/src/typings/index.ts b/src/typings/index.ts index ab8a7cc..fde638b 100644 --- a/src/typings/index.ts +++ b/src/typings/index.ts @@ -1,11 +1,6 @@ -export * from "./Autocomplete" -export * from "./Button" -export * from "./Command" -export * from "./ContextMenu" export * from "./Cron" -export * from "./Event" +export * from "./Discord" export * from "./General" export * from "./Guild" -export * from "./Modal" export * from "./Player" -export * from "./SubCommand" +export * from "./TimeZones"