maybe it just needs time to work idk
All checks were successful
Deploy Backend / docker (ubuntu-latest) (push) Successful in 43s

This commit is contained in:
Lee 2024-10-25 18:29:57 +01:00
parent 7e1d172b43
commit 9fb5317bc8
2 changed files with 17 additions and 12 deletions

@ -1,4 +1,4 @@
import { Client } from "discordx";
import { Client, MetadataStorage } from "discordx";
import { ActivityType, EmbedBuilder } from "discord.js";
import { Config } from "@ssr/common/config";
@ -10,7 +10,7 @@ export enum DiscordChannels {
}
const client = new Client({
intents: [],
intents: ["Guilds", "GuildMessages"],
presence: {
status: "online",
@ -31,15 +31,20 @@ client.once("ready", () => {
export async function initDiscordBot() {
console.log("Initializing discord bot...");
// We will now build our application to load all the commands/events for both bots.
MetadataStorage.instance.build().then(async () => {
// Setup slash commands
client.once("ready", async () => {
await client.initApplicationCommands();
console.log(client.applicationCommands);
});
client.on("interactionCreate", interaction => {
client.executeInteraction(interaction);
});
// Login
await client.login(Config.discordBotToken!);
});
}
/**

@ -162,10 +162,10 @@ app.use(
})
);
app.onStart(() => {
app.onStart(async () => {
console.log("Listening on port http://localhost:8080");
if (isProduction()) {
initDiscordBot();
await initDiscordBot();
}
});