Initial commit of Discord bot

This commit is contained in:
VinceC
2024-09-16 04:22:47 -05:00
commit d50c7c5b15
3950 changed files with 365981 additions and 0 deletions

34
deploy-commands.js Normal file
View File

@@ -0,0 +1,34 @@
const { REST, Routes, SlashCommandBuilder } = require('discord.js');
require('dotenv').config();
const commands = [
new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
new SlashCommandBuilder()
.setName('finduser')
.setDescription('Find a user by username')
.addStringOption(option =>
option.setName('username')
.setDescription('The username to search for')
.setRequired(true)),
// Add more commands here
];
const rest = new REST({ version: '10' }).setToken(process.env.BOT_TOKEN);
(async () => {
try {
console.log('Started refreshing application (/) commands.');
console.log('Commands to be deployed:', commands);
await rest.put(
Routes.applicationCommands(process.env.CLIENT_ID),
{ body: commands },
);
console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
})();