xyter/src/commands/profile/index.ts
2022-04-10 00:06:30 +02:00

25 lines
770 B
TypeScript

import { SlashCommandBuilder } from '@discordjs/builders';
import view from './addons/view';
import { CommandInteraction } from 'discord.js';
export default {
data: new SlashCommandBuilder()
.setName('profile')
.setDescription('Your profile.')
.addSubcommand((subcommand) =>
subcommand
.setName('view')
.setDescription('View a profile.')
.addUserOption((option) =>
option
.setName('target')
.setDescription('The profile you wish to view')
)
),
async execute(interaction: CommandInteraction) {
// If subcommand is view
if (interaction.options.getSubcommand() === 'view') {
// Execute view addon
await view(interaction);
}
},
};