src/funkyquizbot/app.py
def menu(event, menutext=None):
    "show a menu of available options"
    if menutext is None:
        menutext = _("Yo! What are you up to?")
    sender_id = event.sender_id
    message = event.message_text
    MENU_OPTIONS = {'startquiz':_('Start a quiz'),
                    'talk':_('Talk to the show producers'),
                    'watchshow':_('Watch the show')}
    buttons = []
    for value,text in MENU_OPTIONS.items():
        buttons.append(
            QuickReply(title=text, payload=encode_payload('MENU', {'menu':value}))
        )
    # TODO: quick_replies is limited to 11, prune incorrect answers if too many
    app.logger.debug("sending menu: %s", buttons)
    page.send(sender_id, menutext, quick_replies=buttons)
    page.typing_off(sender_id)
show a menu of available options
show a menu of available options
show a menu of available options
def menu(event, menutext=None):
    if menutext is None:
        menutext = _("Yo! What are you up to?")
    sender_id = event.sender_id
    message = event.message_text
    MENU_OPTIONS = {'startquiz':_('Start a quiz'),
                    'talk':_('Talk to the show producers'),
                    'watchshow':_('Watch the show')}
    buttons = []
    for value,text in MENU_OPTIONS.items():
        buttons.append(
            QuickReply(title=text, payload=encode_payload('MENU', {'menu':value}))
        )
    app.logger.debug("sending menu: %s", buttons)
    page.send(sender_id, menutext, quick_replies=buttons)
    page.typing_off(sender_id)
def menu ( event , menutext = None ) : if menutext is None : menutext = _ ( "Yo! What are you up to?" ) sender_id = event . sender_id message = event . message_text MENU_OPTIONS = { 'startquiz' : _ ( 'Start a quiz' ) , 'talk' : _ ( 'Talk to the show producers' ) , 'watchshow' : _ ( 'Watch the show' ) } buttons = [ ] for value , text in MENU_OPTIONS . items ( ) : buttons . append ( QuickReply ( title = text , payload = encode_payload ( 'MENU' , { 'menu' : value } ) ) ) app . logger . debug ( "sending menu: %s" , buttons ) page . send ( sender_id , menutext , quick_replies = buttons ) page . typing_off ( sender_id )
show a menu of available options
show a menu of available options
"show a menu of available options" # TODO: quick_replies is limited to 11, prune incorrect answers if too many
event
menutext