© 2026 Hedgehog Software, LLC
import { ApplyOptions } from "@sapphire/decorators"; import { InteractionHandler, InteractionHandlerTypes, } from "@sapphire/framework"; import type { AutocompleteInteraction } from "discord.js"; import config from "../config.js"; ... // logs correctly console.log('fuse') @ApplyOptions<InteractionHandler.Options>({ interactionHandlerType: InteractionHandlerTypes.Autocomplete, }) export class AutocompleteHandler extends InteractionHandler { ... public override async parse(interaction: AutocompleteInteraction) { const focusedOption = interaction.options.getFocused(true); // doesnt log console.log(focusedOption.name); switch (focusedOption.name) { case "server_name": { // doesnt log console.log("test"); return this.some( .. ); } default: return this.none(); } } }
Join the Discord to ask follow-up questions and connect with the community
Sapphire is a next-gen object-oriented Discord.js bot framework.
2,286 Members