2022-10-07 10:49:05 +02:00
|
|
|
require('dotenv').config();
|
2022-10-07 12:02:35 +02:00
|
|
|
|
|
|
|
const { Client, GatewayIntentBits } = require('discord.js');
|
|
|
|
const token = process.env.TOKEN;
|
|
|
|
|
|
|
|
const client = new Client({
|
|
|
|
intents: [GatewayIntentBits.Guilds]
|
|
|
|
})
|
|
|
|
|
|
|
|
client.once('ready', () => {
|
2022-10-07 13:54:17 +02:00
|
|
|
console.log('Bot is Ready!');
|
2022-10-07 12:02:35 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
client.on('interactionCreate', async interaction => {
|
|
|
|
if (!interaction.isCommand()) return;
|
2022-10-07 14:36:12 +02:00
|
|
|
console.log(interaction.commandName);
|
2022-10-07 12:02:35 +02:00
|
|
|
|
2022-10-07 13:54:17 +02:00
|
|
|
let commandName = interaction.commandName;
|
2022-10-07 12:02:35 +02:00
|
|
|
|
2022-10-07 13:54:17 +02:00
|
|
|
if (commandName === "generate") {
|
2022-10-07 14:36:12 +02:00
|
|
|
if (interaction.options.getSubcommand() === "host") {
|
|
|
|
let rating = interaction.options.getNumber("rating");
|
|
|
|
let type = interaction.options.getString("type") ?? "foundation";
|
|
|
|
await interaction.reply({files: ["./france-in-pictures-beautiful-places-to-photograph-eiffel-tower.jpg"]});
|
|
|
|
}
|
2022-10-07 12:02:35 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
client.login(token);
|