maybe it just needs time to work idk
All checks were successful
Deploy Backend / docker (ubuntu-latest) (push) Successful in 43s
All checks were successful
Deploy Backend / docker (ubuntu-latest) (push) Successful in 43s
This commit is contained in:
parent
7e1d172b43
commit
9fb5317bc8
@ -1,4 +1,4 @@
|
|||||||
import { Client } from "discordx";
|
import { Client, MetadataStorage } from "discordx";
|
||||||
import { ActivityType, EmbedBuilder } from "discord.js";
|
import { ActivityType, EmbedBuilder } from "discord.js";
|
||||||
import { Config } from "@ssr/common/config";
|
import { Config } from "@ssr/common/config";
|
||||||
|
|
||||||
@ -10,7 +10,7 @@ export enum DiscordChannels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const client = new Client({
|
const client = new Client({
|
||||||
intents: [],
|
intents: ["Guilds", "GuildMessages"],
|
||||||
presence: {
|
presence: {
|
||||||
status: "online",
|
status: "online",
|
||||||
|
|
||||||
@ -31,15 +31,20 @@ client.once("ready", () => {
|
|||||||
export async function initDiscordBot() {
|
export async function initDiscordBot() {
|
||||||
console.log("Initializing discord bot...");
|
console.log("Initializing discord bot...");
|
||||||
|
|
||||||
// Setup slash commands
|
// We will now build our application to load all the commands/events for both bots.
|
||||||
client.once("ready", async () => {
|
MetadataStorage.instance.build().then(async () => {
|
||||||
await client.initApplicationCommands();
|
// Setup slash commands
|
||||||
});
|
client.once("ready", async () => {
|
||||||
client.on("interactionCreate", interaction => {
|
await client.initApplicationCommands();
|
||||||
client.executeInteraction(interaction);
|
console.log(client.applicationCommands);
|
||||||
});
|
});
|
||||||
|
client.on("interactionCreate", interaction => {
|
||||||
|
client.executeInteraction(interaction);
|
||||||
|
});
|
||||||
|
|
||||||
await client.login(Config.discordBotToken!);
|
// 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");
|
console.log("Listening on port http://localhost:8080");
|
||||||
if (isProduction()) {
|
if (isProduction()) {
|
||||||
initDiscordBot();
|
await initDiscordBot();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user