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();
}
}
}
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();
}
}
}