const Command = require('../../structures/CommandClass');
module.exports = class Akinator extends Command {
constructor(client) {
super(client, {
data: new SlashCommandBuilder()
.setName('akinator')
.setDescription('akinator.')
.setDMPermission(true)
.addStringOption(option =>
option.setName(`language`)
.setDescription(`option`)
.setRequired(true)
.setAutocomplete(true)),
usage: 'akinator',
category: 'akinator',
permissions: ['Use Application Commands', 'Send Messages', 'Embed Links'],
});
}
async autocomplete(client, interaction) {
const focusedValue = interaction.options.getFocused();
const choices = ['Popular Topics: Threads', 'Sharding: Getting started', 'Library: Voice Connections', 'Interactions: Replying to slash commands', 'Popular Topics: Embed preview'];
const filtered = choices.filter(choice => choice.startsWith(focusedValue));
await interaction.respond(
filtered.map(choice => ({ name: choice, value: choice })),
);
}
async run(client, interaction) {
// Your run logic here
}
};
const Command = require('../../structures/CommandClass');
module.exports = class Akinator extends Command {
constructor(client) {
super(client, {
data: new SlashCommandBuilder()
.setName('akinator')
.setDescription('akinator.')
.setDMPermission(true)
.addStringOption(option =>
option.setName(`language`)
.setDescription(`option`)
.setRequired(true)
.setAutocomplete(true)),
usage: 'akinator',
category: 'akinator',
permissions: ['Use Application Commands', 'Send Messages', 'Embed Links'],
});
}
async autocomplete(client, interaction) {
const focusedValue = interaction.options.getFocused();
const choices = ['Popular Topics: Threads', 'Sharding: Getting started', 'Library: Voice Connections', 'Interactions: Replying to slash commands', 'Popular Topics: Embed preview'];
const filtered = choices.filter(choice => choice.startsWith(focusedValue));
await interaction.respond(
filtered.map(choice => ({ name: choice, value: choice })),
);
}
async run(client, interaction) {
// Your run logic here
}
};