Files
discordeno/examples/minimal/mod.ts
Awesome Stickz 80eabe5f44 Emoji rest methods (node-migration-clean) (#2713)
* feat: all emoji rest methods

* Fix code style issues with ESLint

Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
2023-01-05 15:16:20 -06:00

55 lines
1.1 KiB
TypeScript

import {
ActivityTypes,
createBot,
enableCachePlugin,
enableCacheSweepers,
fastFileLoader,
GatewayIntents,
startBot,
} from "./deps.ts";
import { BOT_ID, BOT_TOKEN } from "./configs.ts";
import { logger } from "./src/utils/logger.ts";
import { events } from "./src/events/mod.ts";
import { updateCommands } from "./src/utils/helpers.ts";
const log = logger({ name: "Main" });
log.info("Starting Bot, this might take a while...");
const paths = ["./src/events", "./src/commands"];
await fastFileLoader(paths).catch((err) => {
log.fatal(`Unable to Import ${paths}`);
log.fatal(err);
Deno.exit(1);
});
export const bot = enableCachePlugin(
createBot({
token: BOT_TOKEN,
botId: BOT_ID,
intents: GatewayIntents.Guilds,
events,
}),
);
// @ts-nocheck: no-updated-depencdencies
enableCacheSweepers(bot);
bot.gateway.manager.createShardOptions.makePresence = (shardId: number) => {
return {
shardId,
status: "online",
activities: [
{
name: "Discordeno is the Best Lib",
type: ActivityTypes.Game,
createdAt: Date.now(),
},
],
};
};
await startBot(bot);
await updateCommands(bot);