Changing commands to dynamic handling rather than if/else.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('ping')
|
||||
.setDescription('Pings caller!'),
|
||||
async execute(interaction) {
|
||||
await interaction.reply(`Ping! <@${interaction.user.id}>`);
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('server')
|
||||
.setDescription('Provides server information.'),
|
||||
async execute(interaction) {
|
||||
await interaction.reply(`Server name: ${interaction.guild.name}\nTotal members: ${interaction.guild.memberCount}`);
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('user')
|
||||
.setDescription('Provides user information.'),
|
||||
async execute(interaction) {
|
||||
await interaction.reply(`Your tag: ${interaction.user.tag}\nYour id: ${interaction.user.id}`);
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user