Clearing Buttons/Actionrows

Howdy How can i clear actionsrows/buttons of a message? I had two ideas: 1)
it.edit {
components?.clear()
}
it.edit {
components?.clear()
}
2)
it.edit {
actionRow { }
}
it.edit {
actionRow { }
}
The first one does not send an update to discord. The second only adds actionRows to the components set
11 Replies
g
g2y ago
components = emptyList()
kxmpxtxnt
kxmpxtxntOP2y ago
so i tried like this but it doesnt have any impact on the messages
No description
g
g2y ago
are you sure the code is being run? do you have the messages intent?
kxmpxtxnt
kxmpxtxntOP2y ago
pretty sure because i can create messages and add actionrows to them
g
g2y ago
channel.messages iterates all the messages in the channel though, you can't just get messages from the API without the intent
kxmpxtxnt
kxmpxtxntOP2y ago
this is my configuration
No description
g
g2y ago
ah, you're using KordEx
kxmpxtxnt
kxmpxtxntOP2y ago
Oh yes, sorry should have mentioned it
g
g2y ago
I mean yeah just setting the components to an empty list should work that's why I'm wondering if your code is actually being run maybe stick a breakpoint in it oh wait you're using onEach that's a flow onEach on its own won't do anything, you still need to consume the flow
kxmpxtxnt
kxmpxtxntOP2y ago
oh wow im dumb tysm :D
g
g2y ago
yw

Did you find this page helpful?