Rebuilt the last command registering to be more consistent with the discord.js guide's system.
53 lines
988 B
JavaScript
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}`);
|
|
},
|
|
}; |