#buttons without miru
1 messages · Page 1 of 1 (latest)
I can't get it to work. Can you provide example
sure ```py
create a new action row
action_row = bot.rest.build_message_action_row()
add a button
action_row.add_button(hikari.ButtonStyle.PRIMARY, "my_button").set_label("Click on me!").add_to_container()
adding a new button to the container, the add_to_container is important
sending the component
await your_send_method("Here's a cool button!", component=action_row)
you can build upto 5 action rows for a message and send them using components arg in your respond method
great!
How do I make sure the person who ran the command is clicking on the button?
Otherwise don't do anything
are you using wait_for inside the command or a seperate listener
Separate listener. But if it cant be in that way I will use wait_for
Can you tell me how
there are other ways but me personally would just set the button's custom_id as the command author's ID
and check if interaction author's ID on clicking the button is same as the custom_id
Multiple button can have same custom_id?
yes
no wait multiple components in same action row can't .
I can have multiple buttons so in that case?