K
Kord3mo ago
kxmpxtxnt

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
gdude
gdude3mo ago
components = emptyList()
kxmpxtxnt
kxmpxtxnt3mo ago
so i tried like this but it doesnt have any impact on the messages
No description
gdude
gdude3mo ago
are you sure the code is being run? do you have the messages intent?
kxmpxtxnt
kxmpxtxnt3mo ago
pretty sure because i can create messages and add actionrows to them
gdude
gdude3mo ago
channel.messages iterates all the messages in the channel though, you can't just get messages from the API without the intent
kxmpxtxnt
kxmpxtxnt3mo ago
this is my configuration
No description
gdude
gdude3mo ago
ah, you're using KordEx
kxmpxtxnt
kxmpxtxnt3mo ago
Oh yes, sorry should have mentioned it
gdude
gdude3mo 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
kxmpxtxnt3mo ago
oh wow im dumb tysm :D
gdude
gdude3mo ago
yw
Want results from more Discord servers?
Add your server