A component requires the ComponentInterface class!
import { ComponentContext, ComponentInterface } from "discord-interactionhandler-js";class Comp extends ComponentInterface { get custom_id() { return "comp_1"; } async run(ctx: ComponentContext) { }} Copy
import { ComponentContext, ComponentInterface } from "discord-interactionhandler-js";class Comp extends ComponentInterface { get custom_id() { return "comp_1"; } async run(ctx: ComponentContext) { }}
This function set the custom id!
The function must be return a string!
"" Copy
""
This function is executed when the component is called!
This function can be used in to send a error message in discord!
The function returns the error reply!
A component requires the ComponentInterface class!
Example