mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-28 14:30:11 +00:00
* fix: bot pkg test * Fix code style issues with ESLint * Update Guild.ts * Update Guild.ts * Fix code style issues with ESLint Co-authored-by: Lint Action <lint-action@samuelmeuli.com> Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>
38 lines
1021 B
TypeScript
38 lines
1021 B
TypeScript
import { configs } from './configs.ts.js';
|
|
import type {
|
|
BotWithCache,
|
|
BotWithHelpersPlugin} from './deps.ts.js';
|
|
import {
|
|
Collection,
|
|
createBot,
|
|
enableCachePlugin,
|
|
enableCacheSweepers,
|
|
enableHelpersPlugin,
|
|
enablePermissionsPlugin,
|
|
GatewayIntents,
|
|
} from './deps.ts.js';
|
|
import type { Command } from './src/types/commands.ts.js';
|
|
|
|
// MAKE THE BASIC BOT OBJECT
|
|
const bot = createBot({
|
|
token: configs.token,
|
|
botId: configs.botId,
|
|
intents: GatewayIntents.Guilds,
|
|
events: {},
|
|
});
|
|
|
|
// ENABLE ALL THE PLUGINS THAT WILL HELP MAKE IT EASIER TO CODE YOUR BOT
|
|
enableHelpersPlugin(bot);
|
|
enableCachePlugin(bot);
|
|
enableCacheSweepers(bot as BotWithCache);
|
|
enablePermissionsPlugin(bot as BotWithCache);
|
|
|
|
export interface BotClient extends BotWithCache<BotWithHelpersPlugin> {
|
|
commands: Collection<string, Command>;
|
|
}
|
|
|
|
// THIS IS THE BOT YOU WANT TO USE EVERYWHERE IN YOUR CODE! IT HAS EVERYTHING BUILT INTO IT!
|
|
export const Bot = bot as BotClient;
|
|
// PREPARE COMMANDS HOLDER
|
|
Bot.commands = new Collection();
|