Added support for type commands
This commit is contained in:
parent
abb422c7f1
commit
4c853ae503
3 changed files with 39 additions and 14 deletions
12
index.js
12
index.js
|
@ -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')}`);
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue