breaking bad 2
This commit is contained in:
24
src/bot.ts
24
src/bot.ts
@@ -1,12 +1,10 @@
|
||||
import { createBot, Intents, Message } from "@discordeno";
|
||||
import { createBot, createDesiredPropertiesObject, Message } from "@discordeno";
|
||||
import { messagehandler } from "./messages.ts";
|
||||
import { EnvConst, loadConfig } from "@root/core/configLoader.ts";
|
||||
|
||||
const env: EnvConst = loadConfig()
|
||||
const env: EnvConst = loadConfig();
|
||||
|
||||
const bot = createBot({
|
||||
token: env.BOT_TOKEN,
|
||||
desiredProperties: {
|
||||
const desiredProperties = createDesiredPropertiesObject({
|
||||
message: {
|
||||
id: true,
|
||||
author: true,
|
||||
@@ -16,20 +14,24 @@ const bot = createBot({
|
||||
toggles: true, // Toggles includes the "bot" flag
|
||||
username: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
interface BotDesiredProperties extends Required<typeof desiredProperties> {}
|
||||
|
||||
const bot = createBot({
|
||||
token: env.BOT_TOKEN,
|
||||
|
||||
events: {
|
||||
ready() {
|
||||
console.log("Bot is ready!");
|
||||
},
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
bot.events.messageCreate = (message) => {
|
||||
messagehandler(bot, message as Message)
|
||||
}
|
||||
messagehandler(bot, message as Message);
|
||||
};
|
||||
|
||||
// Setup desired properties
|
||||
|
||||
|
||||
await bot.start()
|
||||
await bot.start();
|
||||
|
||||
Reference in New Issue
Block a user