27 lines
935 B
TypeScript
27 lines
935 B
TypeScript
import { SlashCommandBuilder } from '@discordjs/builders';
|
|
import { CommandInteraction, GuildMember } from 'discord.js';
|
|
import { changeCounterInteraction } from '../lib/counter';
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName('increase2')
|
|
.setDescription('Increase the cream counter')
|
|
.addIntegerOption((option) =>
|
|
option
|
|
.setName('amount')
|
|
.setRequired(false)
|
|
.setDescription('Amount to increase the counter by')
|
|
.setMinValue(1)
|
|
),
|
|
|
|
execute: async (interaction: CommandInteraction, member: GuildMember) => {
|
|
if (member.id !== '212481359589933056')
|
|
return await interaction.reply({
|
|
ephemeral: true,
|
|
content: 'you are not Dragon.'
|
|
});
|
|
await interaction.deferReply({ephemeral: true});
|
|
const amount = Math.trunc(interaction.options.getInteger('amount') || 1);
|
|
changeCounterInteraction(interaction, member, amount);
|
|
}
|
|
}; |