Added support for type commands

This commit is contained in:
Sebastian Fischlmayr 2022-10-07 13:54:17 +02:00
parent abb422c7f1
commit 4c853ae503
Signed by: Maverick
GPG key ID: 6379E413924A4E77
3 changed files with 39 additions and 14 deletions

View file

@ -8,20 +8,16 @@ const client = new Client({
})
client.once('ready', () => {
console.log('Ready!');
console.log('Bot is Ready!');
});
client.on('interactionCreate', async interaction => {
if (!interaction.isCommand()) return;
const commandName = interaction.commandName;
let commandName = interaction.commandName;
if (commandName === 'ping') {
await interaction.reply('Pong!');
} else if (commandName === 'server') {
await interaction.reply(`Server name: ${interaction.guild.name}\nTotal members: ${interaction.guild.memberCount}`);
} else if (commandName === 'user') {
await interaction.reply(`Your tag: ${interaction.user.tag}\nYour id: ${interaction.user.id}`);
if (commandName === "generate") {
await interaction.reply(`Generating ${interaction.options.getString('type')}`);
}
})