Button handler not triggering

Heyah @Helpers I basically added a button handler from https://www.sapphirejs.dev/docs/Guide/application-commands/interaction-handlers/buttons in /listeners and changed the example's button ID with the one from
const buttonRow = new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
.setCustomId("foo")
.setLabel("do stuff")
.setStyle(ButtonStyle.Primary),
);
const buttonRow = new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
.setCustomId("foo")
.setLabel("do stuff")
.setStyle(ButtonStyle.Primary),
);
but interaction just fails on click and im not too sure how to debug this - nothing else happens on logs beside Loaded 26 listeners :/ Any idea how to debug and maybe even fix?
Sapphire Framework
Buttons | Sapphire
Buttons are components that are clickable. You will recieve an interaction for every click of a button! Here's an
13 Replies
vladdy
vladdy•2y ago
interaction handlers do not go in the listeners folder also please dont ping the role with every question! You should ping it if you dont get a response for a while
vladdy
vladdy•2y ago
Sapphire Framework
What are they? | Sapphire
These are interaction handlers! A simple class you can extend to handle almost all the interactions you may receive in
Shoodey
Shoodey•2y ago
oh my bad - could we please make this clearer in new post guidelines? 😇
vladdy
vladdy•2y ago
Yeah, I'll update it to make it a bit clearer dw done
Shoodey
Shoodey•2y ago
awesome and thanks for the doc link, it works now One more thing, what are the listeners, preconditions and arguments that are logged as loaded on bot startup? is there a list somewhere to know what actually happened?
vladdy
vladdy•2y ago
Most of those are preincluded pieces we provide for most common checks and features
Shoodey
Shoodey•2y ago
is there a list on docs? couldnt find smth that looks like it
vladdy
vladdy•2y ago
I dont think we document a list of it but you can always check it on the github repo!
Shoodey
Shoodey•2y ago
if so just confirm i will keep looking fair! thanks again
vladdy
vladdy•2y ago
for arguments, its not really...useful, but things like preconditions are
Shoodey
Shoodey•2y ago
yeah will dive into preconds pretty soon - guards have been a B to implement on bare discordjs
vladdy
vladdy•2y ago
What I can say is the listeners we load handle the following - initializing command registries and registering commands - parsing interactions received and mapping them according to their types (interaction handlers, commands, etc) - optionally, if enabled, the listeners that help parse a received message and run the command for it
vladdy
vladdy•2y ago
GitHub
framework/src/preconditions at main · sapphiredev/framework
Discord bot framework built on top of discord.js for advanced and amazing bots. - framework/src/preconditions at main · sapphiredev/framework