Init Commit

Server
- Working init discord bot
    - Modular events and commands
    - Has access to the socket server
- Working init socket server
    - Need to work on getting access to discord bot
- Working init web server

Currently working on breaking out the init of the socket server

Client
- Working init socket client

Currently working on the discord bot to join voice channels
This commit is contained in:
Logan Cusano
2024-01-08 00:12:47 -05:00
parent 86dd058d2a
commit 4a0b1004d2
16 changed files with 2599 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
import { Events } from 'discord.js';
export const name = Events.InteractionCreate;
export async function execute(nodeIo, interaction) {
const command = interaction.client.commands.get(interaction.commandName);
console.log("Interaction created for command: ", command);
// Execute autocomplete if the user is checking autocomplete
/*
if (interaction.isAutocomplete()) {
console.log("Running autocomplete for command: ", command.data.name);
return await command.autocomplete(interaction);
}
*/
// Check if the interaction is a command
if (!interaction.isChatInputCommand()) return;
if (!command) {
console.error(`No command matching ${interaction.commandName} was found.`);
return;
}
console.log(`${interaction.member.user} is running '${interaction.commandName}'`);
command.execute(nodeIo, interaction);
}