jillo-bot/src/commands/increase2.ts

31 lines
1.1 KiB
TypeScript

import { GuildMember, Interaction, SlashCommandBuilder } from 'discord.js';
import { changeCounterInteraction } from '../lib/counter';
import { knownServers } from '../lib/knownServers';
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)
),
serverWhitelist: [...knownServers.firepit],
execute: async (interaction: Interaction, member: GuildMember) => {
if (!interaction.isChatInputCommand()) return;
if (member.id !== '212481359589933056' && member.id !== '321126371189587968')
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, true);
}
};