26 lines
879 B
TypeScript
26 lines
879 B
TypeScript
import { GuildMember, Interaction, SlashCommandBuilder } from 'discord.js';
|
|
import { changeCounterInteraction } from '../lib/counter';
|
|
import { knownServers } from '../lib/knownServers';
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName('increase')
|
|
.setDescription('Increase the 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;
|
|
|
|
await interaction.deferReply({ephemeral: true});
|
|
const amount = Math.trunc(interaction.options.getInteger('amount') || 1);
|
|
changeCounterInteraction(interaction, member, amount, false);
|
|
}
|
|
}; |