fix: run option in autocomplete instead command

This commit is contained in:
Jozef Steinhübl 2023-08-24 16:10:14 +02:00
parent c4b21275f9
commit 0c5f2d21c1
2 changed files with 1 additions and 7 deletions

View file

@ -53,10 +53,5 @@ async function handleAutocomplete(interaction: AutocompleteInteraction) {
const context = new AutocompleteContext(option, command, interaction); const context = new AutocompleteContext(option, command, interaction);
await Promise.resolve(command.run(context)) await option.run(context);
.catch(async error => {
context.respond({
content: `Something went wrong... ${error.message} (${error.code})`
});
});
} }

View file

@ -1,5 +1,4 @@
import { REST, Routes, SlashCommandBuilder } from "discord.js"; import { REST, Routes, SlashCommandBuilder } from "discord.js";
import { Bubu } from "../structs/Client.ts";
import type { Command } from "../structs/Command.ts"; import type { Command } from "../structs/Command.ts";
export const COMMANDS: Map<string, Command> = new Map(); export const COMMANDS: Map<string, Command> = new Map();