Files
discordeno/examples/advanced/src/bot.ts
Fleny f199bbf71c build(dev-deps): Update biome to v2 (#4246)
* update biome to v2

* Run biome check --write

* Update biome.jsonc

Co-authored-by: Link <lts20050703@gmail.com>

* Fix config error

* Bump biome version

* Update website/yarn.lock

* Update biome to 2.1.3

---------

Co-authored-by: Link <lts20050703@gmail.com>
2025-08-09 12:45:04 -05:00

57 lines
1.3 KiB
TypeScript

import { createBot, type logger as discordenoLogger, Intents, LogDepth } from '@discordeno/bot'
import { createProxyCache } from 'dd-cache-proxy'
import { configs } from './config.js'
const rawBot = createBot({
token: configs.token,
intents: Intents.Guilds,
desiredProperties: {
interaction: {
id: true,
type: true,
data: true,
token: true,
guildId: true,
member: true,
},
guild: {
id: true,
name: true,
roles: true,
ownerId: true,
},
role: {
id: true,
guildId: true,
permissions: true,
},
member: {
id: true,
roles: true,
},
channel: {
id: true,
},
user: {
id: true,
username: true,
discriminator: true,
},
},
})
export const bot = createProxyCache(rawBot, {
desiredProps: {
guild: ['id', 'name', 'ownerId', 'roles'],
roles: ['id', 'guildId', 'permissions'],
},
cacheInMemory: {
guild: true,
role: true,
default: false,
},
})
// By default, bot.logger will use an instance of the logger from @discordeno/bot, this logger supports depth and we need to change it, so we need to say to TS that we know what we are doing with as
;(bot.logger as typeof discordenoLogger).setDepth(LogDepth.Full)