feat: command arguments

This commit is contained in:
TresAbhi committed 2023-04-19 00:26:51 +00:00
1 parent b84ef0cebf
commit 363f110c2f
6 files changed
+191 -25

No files matched your search

-9
View File
@@ -1,9 +0,0 @@
import { SlashCommandBuilder } from 'discord.js';
export const data = new SlashCommandBuilder()
.setName('verify')
.setDescription('Verifies the user with Blitz');
export async function execute(interaction) {
await interaction.reply('uwu i done nothin here uwu');
}
+34
View File
@@ -0,0 +1,34 @@
import { CommandInteraction, SlashCommandBuilder } from 'discord.js';
export function execute(interaction: CommandInteraction) {
interaction.reply(
//@ts-ignore
`you said your blitz username was ${interaction.options.getString(
'ign',
)} in ${
//@ts-ignore
interaction.options.getString('server')
}`,
);
}
export const data = new SlashCommandBuilder()
.setName('verify')
.setDescription('Verifies the user with Blitz')
.addStringOption((option) =>
option
.setName('server')
.setDescription('The Blitz server you are in')
.setRequired(true)
.addChoices(
{ name: 'NA', value: 'na' },
{ name: 'EU', value: 'eu' },
{ name: 'ASIA', value: 'asia' },
),
)
.addStringOption((option) =>
option
.setName('ign')
.setDescription('The username you use in Blitz')
.setRequired(true),
);