src/funkyquizbot/app.py
def callback_menu(payload, event):
    "A callback for any MENU payload we get. "
    sender_id = event.sender_id
    page.typing_on(sender_id)
    prefix, metadata = decode_payload(payload)
    app.logger.debug('Got MENU: {} '.format(metadata['menu']))
    if metadata['menu'] == 'startquiz':
        quiz(event)
    elif metadata['menu'] == 'watchshow':
        tpl = Template.Generic([
                Template.GenericElement(env('WEBPAGE_TITLE'),
                    subtitle=env('WEBPAGE_SUBTITLE'),
                    item_url=env('WEBPAGE_URL'),
                    image_url=env('WEBPAGE_LOGO'),
                    buttons=[
                        Template.ButtonWeb(_('Watch it now'), env('WEBPAGE_URL'))
                    ])
        ])
        page.send(sender_id, tpl)
    elif metadata['menu'] == 'talk':
        # TODO: Figure out how to make a dialogue work
        page.send(sender_id, _("Yes. What do you want to say?"))
A callback for any MENU payload we get. 
A callback for any MENU payload we get.
A callback for any MENU payload we get .
def callback_menu(payload, event):
    sender_id = event.sender_id
    page.typing_on(sender_id)
    prefix, metadata = decode_payload(payload)
    app.logger.debug('Got MENU: {} '.format(metadata['menu']))
    if metadata['menu'] == 'startquiz':
        quiz(event)
    elif metadata['menu'] == 'watchshow':
        tpl = Template.Generic([
                Template.GenericElement(env('WEBPAGE_TITLE'),
                    subtitle=env('WEBPAGE_SUBTITLE'),
                    item_url=env('WEBPAGE_URL'),
                    image_url=env('WEBPAGE_LOGO'),
                    buttons=[
                        Template.ButtonWeb(_('Watch it now'), env('WEBPAGE_URL'))
                    ])
        ])
        page.send(sender_id, tpl)
    elif metadata['menu'] == 'talk':
        page.send(sender_id, _("Yes. What do you want to say?"))
def callback_menu ( payload , event ) : sender_id = event . sender_id page . typing_on ( sender_id ) prefix , metadata = decode_payload ( payload ) app . logger . debug ( 'Got MENU: {} ' . format ( metadata [ 'menu' ] ) ) if metadata [ 'menu' ] == 'startquiz' : quiz ( event ) elif metadata [ 'menu' ] == 'watchshow' : tpl = Template . Generic ( [ Template . GenericElement ( env ( 'WEBPAGE_TITLE' ) , subtitle = env ( 'WEBPAGE_SUBTITLE' ) , item_url = env ( 'WEBPAGE_URL' ) , image_url = env ( 'WEBPAGE_LOGO' ) , buttons = [ Template . ButtonWeb ( _ ( 'Watch it now' ) , env ( 'WEBPAGE_URL' ) ) ] ) ] ) page . send ( sender_id , tpl ) elif metadata [ 'menu' ] == 'talk' : page . send ( sender_id , _ ( "Yes. What do you want to say?" ) )
A callback for any MENU payload we get.
A callback for any MENU payload we get .
"A callback for any MENU payload we get. " # TODO: Figure out how to make a dialogue work
payload
event