2025-02-27 03:56:30 +00:00
|
|
|
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,
|
2025-03-01 21:10:31 +00:00
|
|
|
] 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,
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
})
|
2025-02-27 03:56:30 +00:00
|
|
|
|
|
|
|
|
export const bot = createBot({
|
|
|
|
|
intents: intents.reduce((acc, curr) => acc | curr, Intents.Guilds),
|
2025-03-01 21:10:31 +00:00
|
|
|
token: config.DISCORD_TOKEN || "",
|
2025-02-27 03:56:30 +00:00
|
|
|
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,
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|