Files
discordeno/examples/minimal/mod.ts
Skillz4Killz 3bbb03b8e3 cleanup cleanup cleanup on isle dd (#2792)
* cleanup cleanup cleanup on isle dd

* fix: rest manager import in test
2023-02-25 20:11:15 -06:00

47 lines
1.1 KiB
TypeScript

import { ActivityTypes, createBot, enableCachePlugin, enableCacheSweepers, fastFileLoader, GatewayIntents, startBot } from './deps.ts.js'
import { BOT_ID, BOT_TOKEN } from './configs.ts.js'
import { logger } from './src/utils/logger.ts.js'
import { events } from './src/events/mod.ts.js'
import { updateCommands } from './src/utils/helpers.ts.js'
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)