This commit is contained in:
Janis
2022-11-06 20:27:55 +01:00
commit aca1ef16e0
14 changed files with 4403 additions and 0 deletions

25
bot/app.js Normal file
View File

@@ -0,0 +1,25 @@
const { Client, GatewayIntentBits } = require("discord.js");
const { registerCommands } = require("./commands");
const config = require("./config");
const { db, insertServer } = require("./database_handler");
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
registerCommands();
client.on("ready", () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on("interactionCreate", async (interaction) => {
console.log();
if (!interaction.isChatInputCommand()) return;
if (interaction.commandName === "setup") {
insertServer(interaction.guildId, interaction.guild.ownerId);
await interaction.reply("Pong!");
}
});
client.login(config.token);