Skip to content

Commit

Permalink
add ButtonPersistentNested related to issue conbus#50
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhjulskov authored Jan 29, 2018
1 parent d91a141 commit fd4af5f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion fbmq/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def convert_shortcut_buttons(items):
result.append(ButtonWeb(title=title, url=value))
elif type == 'postback':
result.append(ButtonPostBack(title=title, payload=value))
elif type == 'nested':
result.append(ButtonPersistentNested(title=title, buttons=value))
elif type == 'phone_number':
result.append(ButtonPhoneNumber(title=title, payload=value))
elif type == 'element_share':
Expand Down Expand Up @@ -59,6 +61,13 @@ def __init__(self, title, payload):
self.payload = payload


class ButtonPersistentNested(BaseButton):
def __init__(self, title, payload):
self.type = 'nested'
self.title = title
self.buttons = buttons


class ButtonPhoneNumber(BaseButton):
def __init__(self, title, payload):
self.type = 'phone_number'
Expand Down Expand Up @@ -173,4 +182,4 @@ def __init__(self, text, account_link_url=None, account_unlink_button=False):
if account_unlink_button:
self.payload['buttons'].append({
'type': 'account_unlink'
})
})

0 comments on commit fd4af5f

Please sign in to comment.