How to pass entities into buttons' payload by using dispatcher

I’m trying to pass some entites into buttons’ payload by using dispatcher like this:

value = 'my_value'
buttons = [{"payload": '/affirm{{"my_entity": ' + f'"{value}"' + '}}', "title": "Accept"},
           {"payload": '/deny{{"my_entity": ' + f'"{value}"' + '}}', "title": "Reject"}]
dispatcher.utter_message(text='Some message', buttons=buttons)

But when I check on the action that was supposed to run after that, the tracker.latest_message has an empty list of 'entities': [] tho the text field has the exact payload: 'text': '/affirm{{"my_entity": "value"}}', how can I get the list of entities inside the entites field?

Use { } instead of {{ }} :slight_smile:

1 Like

A post was split to a new topic: How to mention a user on Telegram by their ID?

A post was split to a new topic: BUTTON_DATA_INVALID when using multiple entities in payload