import type {
	SlashCommandBuilder, Guild, TextBasedChannel, VoiceChannel,
	ChatInputCommandInteraction, AutocompleteInteraction, ButtonInteraction,
	ChannelSelectMenuInteraction, MentionableSelectMenuInteraction, RoleSelectMenuInteraction, StringSelectMenuInteraction, UserSelectMenuInteraction
} from "discord.js"

// Discord.js
declare module "discord.js" {
	export interface Client {
		disco: { interval: NodeJS.Timeout }
	}
}

export interface Command {
	data: SlashCommandBuilder
	execute: (interaction: ChatInputCommandInteraction) => unknown
	autocompleteRun?: (interaction: AutocompleteInteraction) => unknown
}

export interface CommandFolder {
	name: string
	commands: Command[]
}

export interface Button {
	id: string
	execute: (interaction: ButtonInteraction) => unknown
}

export interface ButtonFolder {
	name: string
	commands: Button[]
}

export interface SelectMenu {
	id: string
	execute: (interaction: ChannelSelectMenuInteraction | MentionableSelectMenuInteraction | RoleSelectMenuInteraction | StringSelectMenuInteraction | UserSelectMenuInteraction) => unknown
}

export interface SelectMenuFolder {
	name: string
	commands: SelectMenu[]
}

export interface Event {
	name: string
	once?: boolean
	execute: (...args: unknown[]) => unknown
}

export interface ChannelInferrable {
	channel?: TextBasedChannel | VoiceChannel
	guild?: Guild
}

// Utils
export interface APIResponse {
	result?: boolean
	success?: boolean
	[key: string]: unknown
}

export interface ReturnMsgData {
	status: string
	error_code?: string
	Title?: string
	Message?: string
}

export interface CrackGame {
	name: string
	link: string
}
