Function to get Component Data by ID
I saw that there is a way to pass a numeric ID to a message component, which serves as an identifier to recognize an element, is it possible to get it with some function? That already exists of course or do I need to implement it if I need it?
6 Replies
There is no existing function for this
You would filter recursively through message.components to find items by ID
Thx
If I create it, do you think it would be valid to create a PR or method within interaction.message.components.GetComponentbyID(ID) or does this end up being something extremely specific that is rarely used?
We would not want to support that helper method, no
And message.components is just an array, not a custom class
hate to bump, but is there really no way to get a particular component from a message, especially with componentsV2, without recursively filtering or manually accessing by index??
closest i could get was Message#resolveComponent() which works only with v1 components i'm led to believe
there isn't
though it's pretty much just a one level recursion
for containers
then it's a different case and handling for each component