mirror of
https://github.com/DerTyp7/discord-twitch-bot.git
synced 2025-10-29 12:52:12 +01:00
26 lines
693 B
JavaScript
26 lines
693 B
JavaScript
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);
|