wiki command

Hi, i want to know is it possible. I am making a discord bot for my War Thunder squadron, and i wanted to do a /wiki command, that gives a link to wiki of picked plane/tank, but i got a problem, where i can put only 25 choices of autocomplete. Is there other way to do it? my code without choices:
const { SlashCommandBuilder } = require("discord.js");

module.exports = {
data: new SlashCommandBuilder()
.setName('wiki')
.setDescription('Skrót do wiki War Thundera')
.addStringOption(option => option.setName('pojazd').setDescription('Pojazd do którego chcesz uzyskać link').setAutocomplete(true)),
async autocomplete(interaction, client) {
const focusedValue = interaction.options.getFocused();
const choices = [,
];
const filtered = choices.filter(choice => choice.startsWith(focusedValue));
await interaction.respond(
filtered.map(choice => ({ name: choice, value: choice })),
);
},
async execute(interaction, client) {
const option = interaction.options.getString('pojazd') || " ";
await interaction.reply({ content: `https://wiki.warthunder.com/${option}`})
}
}
const { SlashCommandBuilder } = require("discord.js");

module.exports = {
data: new SlashCommandBuilder()
.setName('wiki')
.setDescription('Skrót do wiki War Thundera')
.addStringOption(option => option.setName('pojazd').setDescription('Pojazd do którego chcesz uzyskać link').setAutocomplete(true)),
async autocomplete(interaction, client) {
const focusedValue = interaction.options.getFocused();
const choices = [,
];
const filtered = choices.filter(choice => choice.startsWith(focusedValue));
await interaction.respond(
filtered.map(choice => ({ name: choice, value: choice })),
);
},
async execute(interaction, client) {
const option = interaction.options.getString('pojazd') || " ";
await interaction.reply({ content: `https://wiki.warthunder.com/${option}`})
}
}
8 Replies
d.js toolkit
d.js toolkit15mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
d.js docs
d.js docs15mo ago
Suggestion for @kkamils:guide Slash Commands: Autocomplete read more
Kameq
Kameq15mo ago
maybe this will help
Unknown User
Unknown User15mo ago
Message Not Public
Sign In & Join Server To View
KamilS
KamilSOP15mo ago
so theres no other way to do it? because of i wanted to do like 1500 of choices xD
Kameq
Kameq15mo ago
Due to discord limitations, you can't
Unknown User
Unknown User15mo ago
Message Not Public
Sign In & Join Server To View
KamilS
KamilSOP15mo ago
okay, i think it will be too much for me, as beginner, thanks for the answers
Want results from more Discord servers?
Add your server