42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
// src/commands/community/meta.js
|
|
const {
|
|
SlashCommandBuilder,
|
|
ModalBuilder,
|
|
TextInputBuilder,
|
|
TextInputStyle,
|
|
ActionRowBuilder,
|
|
} = require('discord.js');
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName('meta')
|
|
.setDescription('Verifica ou atualiza as tuas metas na base de dados.'),
|
|
|
|
async execute(interaction) {
|
|
const modal = new ModalBuilder()
|
|
.setCustomId('definirMeta')
|
|
.setTitle('Definir metas semanais');
|
|
|
|
const carvaoInput = new TextInputBuilder()
|
|
.setCustomId('carvao')
|
|
.setLabel('Meta de carvão')
|
|
.setStyle(TextInputStyle.Short)
|
|
.setPlaceholder('Ex: 1000')
|
|
.setRequired(true);
|
|
|
|
const enxofreInput = new TextInputBuilder()
|
|
.setCustomId('enxofre')
|
|
.setLabel('Meta de enxofre')
|
|
.setStyle(TextInputStyle.Short)
|
|
.setPlaceholder('Ex: 800')
|
|
.setRequired(true);
|
|
|
|
const firstRow = new ActionRowBuilder().addComponents(carvaoInput);
|
|
const secondRow = new ActionRowBuilder().addComponents(enxofreInput);
|
|
|
|
modal.addComponents(firstRow, secondRow);
|
|
|
|
await interaction.showModal(modal);
|
|
},
|
|
};
|
|
|