This commit is contained in:
Jonny_Bro (Nikita) 2023-04-12 14:08:56 +05:00
parent 72dddcc02d
commit 1a3d9e2193

View file

@ -130,13 +130,13 @@ class Help extends BaseCommand {
async autocompleteRun(client, interaction) { async autocompleteRun(client, interaction) {
const command = interaction.options.getString("command"), const command = interaction.options.getString("command"),
commands = [...new Map(client.commands.map(v => [v.constructor.name, v])).values()], commands = [...new Map(client.commands.map(v => [v.constructor.name, v])).values()],
results = commands.filter(c => c.name.includes(command)); results = commands.filter(c => c.command.name.includes(command));
console.log(commands); console.log(commands);
return interaction.respond( return interaction.respond(
results.slice(0, 25).map(command => ({ results.slice(0, 25).map(command => ({
name: command.name, name: command.command.name,
value: command.name, value: command.command.name,
}), }),
)); ));
} }