UNPKG

robtic-discord-startup

Version:

easily set up a Discord bot with configurable settings

87 lines (75 loc) 2.11 kB
import { ActivityType, PresenceStatusData, PermissionResolvable, GatewayIntentBits } from 'discord.js'; export { Command } from './components/newCommand.js'; export { BaseEmbed } from './components/ui/embed.js'; import './command.d-BxTLPTAy.js'; type StringToGatewayIntent = keyof typeof GatewayIntentBits; type levels = "CEO" | "admin" | "mod" | "support"; interface starters { token: string | undefined; clientId: string; clientSecret?: string; mongoURL?: string; } interface activitis { type?: keyof typeof ActivityType, text: string | "test", status?: PresenceStatusData, } interface slashCommands { defaultCooldown?: number, ownerOnly?: boolean, embedDefault?: { footer?: { text: string, iconURL?: string, }, author?: { name: string, iconURL?: string, }, }, } interface RobTicStartup { starter: starters; activity?: activitis; dev?: { guild: string; user?: string; }; slashcommand: slashCommands; access: Partial<Record<levels, { roles: { name: string[]; id: string[] }; perms: PermissionResolvable[]; }>>; intents: StringToGatewayIntent[]; paths?: { CommandPaths?: string, EventsPaths?: string, } } declare class Bot { private config; private errorHandler; private client; constructor(); start(): Promise<void>; close(): Promise<void>; } declare class Database { private database?; private config; constructor(); connect(): Promise<void>; private setupListeners; } declare const db: Database; declare class BotError extends Error { type: "COMMAND" | "EVENT" | "DATABASE"; constructor(message: string, type?: "COMMAND" | "EVENT" | "DATABASE"); } declare const handleError: (err: unknown, location?: string) => void; declare const defineConfig: (config: RobTicStartup) => RobTicStartup; export { Bot, BotError, db, defineConfig, handleError };