Interactions no longer work after bot restart

Does Kordex support some way to make interactions still work after bot restart, besides using Kord's functions for creating components? More specifically, does Kordex support passing data through button IDs? (we'll likely contribute this functionality if it isn't alread supported)
Solution:
You should handle the events
Jump to solution
15 Replies
gdude
gdude7mo ago
There isn't really anything there other than the callback system and that isn't very useful
Solution
gdude
gdude7mo ago
You should handle the events
gdude
gdude7mo ago
I don't think there's really any way to handle this kind of thing without some kind of persistent storage and not all bots are capable of that
Laxystem
Laxystem7mo ago
will serialize event data inside the button ID muhahahahaha (we'll contribute it I think)
gdude
gdude7mo ago
That won't exactly be enough for the KordEx components API Just do that and handle the event yourself
Laxystem
Laxystem7mo ago
Yep, that's what I'm currently doing orgh, I can't use respond and such now I just did whatever this is so that I'll be able to do stuff for both buttons and slash commands
gdude
gdude7mo ago
Use the interaction object on the event
Laxystem
Laxystem7mo ago
(discord forgot to send image)
No description
Laxystem
Laxystem7mo ago
wait, huh? wdym?
gdude
gdude7mo ago
You sounded like you didn't know how to respond
Laxystem
Laxystem7mo ago
I mean, pass the event thingy from the action block to what interaction object?
gdude
gdude7mo ago
That's not what I said event.interaction
Laxystem
Laxystem7mo ago
Ah Yeah that's what I'm doing Follow-up question: I'm still getting the unknown component message in the logs. Is there a way to tell kordex to ignore this interaction?
17:28:45.575 [DefaultDispatcher-worker-7] DEBUG com.kotlindiscord.kord.extensions.components.ComponentRegistry -- Button interaction received for unknown component ID: PM.ping
17:28:45.575 [DefaultDispatcher-worker-7] DEBUG com.kotlindiscord.kord.extensions.components.ComponentRegistry -- Button interaction received for unknown component ID: PM.ping
gdude
gdude7mo ago
I don't recall there being anyting specifically for that but that's a debug log don't use debug logging in production
Laxystem
Laxystem7mo ago
yep, not planning to just annoyed me