basic command handler (messageCreate fixme)

This commit is contained in:
2021-08-23 15:05:17 +02:00
parent 4f82c6efdd
commit 2b5d3fa0b6
7 changed files with 519 additions and 507 deletions

View File

@@ -1,38 +0,0 @@
const { Client, Intents } = require('discord.js');
// const cfg = require('./cfg.json');
// const fs = require('fs');
require('dotenv').config();
const cl = new Client({ intents: [Intents.FLAGS.GUILDS] });
// ======== ======== ======== ======== COMMAND HANDLER
// const cmds = [];
// const cmdsFls = fs
// .readdirSync(`./commands`)
// .filter((file) => file.endsWith(`.js`));
//
// for (const Fl of cmdsFls) {
// const cmd = require(`./commands/${Fl}`);
// cmds.push(cmd.data.toJSON());
// }
// ======== ======== ======== ======== INTERACTIONS (don't work - require slash command registration)
// cl.on('interactionCreate', async (interaction) => {
// if (!interaction.isCommand()) return;
//
// const { commandName } = interaction;
//
// if (commandName === 'ping') {
// await interaction.reply('Pong!');
// } else if (commandName === 'beep') {
// await interaction.reply('Boop!');
// } else if (commandName === 'server') {
// await interaction.reply(`This server's name is: ${interaction.guild.name}`);
// }
// });
cl.once('ready', () => {
console.log(`bot ready`);
});
cl.login(process.env.token);