wynn/ts/src/bot/index.ts
a 6e1595a7c5
Some checks failed
commit-tag / commit-tag-image (push) Failing after 57s
noot
2025-03-01 15:10:31 -06:00

73 lines
2.2 KiB
TypeScript

import { config } from "#/config";
import {createBot, Intents} from "discordeno"
const intents = [
Intents.GuildModeration ,
Intents.GuildWebhooks ,
Intents.GuildExpressions ,
Intents.GuildScheduledEvents ,
Intents.GuildMessagePolls ,
Intents.GuildIntegrations ,
Intents.GuildInvites ,
Intents.GuildMessageReactions ,
Intents.GuildPresences ,
Intents.DirectMessages ,
Intents.DirectMessageReactions ,
Intents.GuildMembers ,
Intents.Guilds ,
Intents.GuildInvites ,
Intents.GuildMessages,
] as const
export const createBotWithToken = (token: string) => createBot({
intents: intents.reduce((acc, curr) => acc | curr, Intents.Guilds),
token: token,
desiredProperties: {
interaction: {
id: true,
data: true,
type: true,
token: true,
message: true,
channelId: true,
channel: true,
guildId: true,
guild: true,
user: true,
member: true,
},
message: {
id: true,
member: true,
guildId: true,
},
}
})
export const bot = createBot({
intents: intents.reduce((acc, curr) => acc | curr, Intents.Guilds),
token: config.DISCORD_TOKEN || "",
desiredProperties: {
interaction: {
id: true,
data: true,
type: true,
token: true,
message: true,
channelId: true,
channel: true,
guildId: true,
guild: true,
user: true,
member: true,
},
message: {
id: true,
member: true,
guildId: true,
},
}
})