Interaction handler parse never being called

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();
}
}
}
3 Replies
mallusrgreat
mallusrgreat3mo ago
Logs:
2024-08-09 19:01:48 - INFO - Logging in
fuse
2024-08-09 19:01:50 - INFO - Logged in
...
2024-08-09 19:01:48 - INFO - Logging in
fuse
2024-08-09 19:01:50 - INFO - Logged in
...
complete code: https://pastes.dev/VuIv4h9j2p
pastes | VuIv4h9j2p
A paste containing 45 lines of typescript.
Sapphire
Sapphire3mo ago
1. Which version of @sapphire/framework are you using? 2. What's your file/folder structure? 3. Did you use the CLI to generate your bot? 4. What's your main (CJS) or module (ESM) property in package.json 5. Are you using TypeScript? And if so, how are you compiling and running your code? That is to say, what are your build and startup scripts? - Did you remove your output folder and rebuild then try again? 6. Is your problem related to message commands? Did you add loadMessageCommandListeners to your SapphireClient options Remember that if you are new to @sapphire/framework it is important that you read the user guide.
Favna
Favna3mo ago
Sepcifically 1, 2, 3, 4, 5
Want results from more Discord servers?
Add your server