mirror of
https://github.com/DerTyp7/discord-twitch-bot.git
synced 2025-10-30 13:17:11 +01:00
init
This commit is contained in:
25
bot/app.js
Normal file
25
bot/app.js
Normal 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);
|
||||
Reference in New Issue
Block a user