bot-framework/@types/Client.d.ts
2024-03-31 20:15:51 +03:00

69 lines
1.8 KiB
TypeScript

import { LoggerClientOptions } from '@navy.gif/logger';
import { GatewayIntentBits, Partials } from 'discord.js';
import { ComponentType } from '../src/client/interfaces/Component.ts';
import Inhibitor from '../src/client/interfaces/Inhibitor.ts';
export type ClientOptions = {
// Set by the startup script
rootDir: string,
version: string,
// User configured
logger: LoggerClientOptions,
developmentMode: boolean,
developers: string[],
prefix: string,
libraryOptions: {
partials?: Partials[],
intents: GatewayIntentBits[],
invalidRequestWarningInterval?: number
}
}
export type ComponentOptions = {
type: ComponentType,
name: string,
disabled?: boolean
};
export type ExtendedCommandOptionDefinition = {
restricted?: boolean
} & CommandOptionDefinition
export type CommandDefinition = {
aliases?: string[],
options?: (ExtendedCommandOptionDefinition | ExtendedCommandOption)[],
restricted?: boolean,
dmOnly?: boolean,
guildOnly?: boolean,
help?: string,
limited?: Snowflake[],
showUsage?: boolean,
sameVc?: boolean,
description?: string,
} & Omit<ComponentOptions, 'type'>
export type ObserverOptions = {
priority?: number,
hooks?: Hooks,
} & Omit<ComponentOptions, 'type'>
export type InhibitorOptions = {
priority?: number,
silent?: boolean
} & Omit<ComponentOptions, 'type'>
export type InhibitorResponse<T extends boolean = boolean> = {
error: T,
inhibitor: Inhibitor,
reason: If<T, string>,
}
export type UserResolveable = Snowflake | User | GuildMember | string;
export type MemberResolveable = UserResolveable
export type RoleResolveable = Snowflake | Role | string;
export type ChannelResolveable = Snowflake | BaseChannel | string;
export type DiscordBaseStruct = {
id: string
}