Define custom action for buttons

How do I define custom action for button defined in templates of domain.yml? I want to define it actions.py instead of domain.yml.

action_mark_done:

  • text: “Would you like to continue?”

    buttons:

    • title: “Yes”

      payload: ‘/mark_done{“choice”: “yes”}’

    • title: “No”

      payload: ‘/mark_done{“choice”: “no”}’

your payload in buttons is typically your intents for predicting the next action

-- Story 1
* mark_done{"choice":"yes"}
- custom_action1

-- Story 2
* mark_done{"choice":"no"}
- custom_action2