This repository has been archived on 2025-10-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Templated.djs/commands/dev/ping.js
Gustavo e0afd91470 Rebuilt the main command registering
Rebuilt the last command registering to be more consistent with the discord.js guide's system.
2021-08-16 20:32:30 -03:00

53 lines
988 B
JavaScript

const {
MessageActionRow,
MessageButton,
} = require('discord.js');
const { SlashCommandBuilder } = require('@discordjs/builders');
module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with pong!'),
/*
name: 'ping',
description: 'Replies with Pong!',
options: [{
name: 'input',
type: 'STRING',
description: 'input arg',
required: true,
}],
permissions: [{
id: '870383205306494997',
type: 'ROLE',
permission: false,
},
{
id: '873349611358670878',
type: 'ROLE',
permission: false,
},
],
*/
async execute(interaction) {
const {
value: input,
} = interaction.options.get('input');
const row = new MessageActionRow()
.addComponents(
new MessageButton()
.setCustomId('button')
.setLabel('Button')
.setStyle('PRIMARY'),
);
interaction.reply({
content: `Ping ${input}`,
components: [row],
});
// console.log(`Ping! ${interaction.options.get('input').value}`);
},
};