from graph import Node, Transition from vuelta import vuelta_hotel from util import asset_path museo1 = Node('Visitarás la Galería Borghese. ¿Qué quieres ver?', [ Transition.with_actions('Escultura', vuelta_hotel, [ lambda bot, id_test: bot.send_photo( id_test, open(asset_path('LaVerdad.jpg'), 'rb'), 'La verità svelata dal Tempo, Bernini, 1645') ]), Transition.with_actions('Pintura', vuelta_hotel, [ lambda bot, id_test: bot.send_photo( id_test, open(asset_path('Danae.jpg'), 'rb'), 'Danae, Correggio, ca. 1531') ]), ], []) museo2 = Node('Visitarás el Castillo de Wawel. ¿Qué quieres ver?', [ Transition.with_actions('Escultura', vuelta_hotel, [ lambda bot, id_test: bot.send_photo( id_test, open(asset_path('DragondeWawel.jpg'), 'rb'), 'Smok Wawelski, Bronisław Chromy, 1970') ]), Transition.with_actions('Pintura', vuelta_hotel, [ lambda bot, id_test: bot.send_photo( id_test, open(asset_path('JupiterMercurioylaVirtud.jpg'), 'rb'), 'Giove pittore di farfalle, Mercurio e la Virtù, Dosso Dossi, 1515-1518' ) ]), ], [])
from graph import Node, Transition from viaje import viaje luz = Node( '¿Tienes luz?', [ #VIDEO NATASSJA TQM # Transition.simple('No', Node.leaf([lambda bot, id_test: bot.send_message(id_test, 'ok')])), Transition.with_actions('Sí', viaje, []), Transition.simple( 'No', Node.leaf([ lambda bot, id_test: bot.send_message( id_test, 'https://www.youtube.com/watch?v=pX6U8FNLozo') ])) ], [])
from util import asset_path signo = Node( 'En la disco conoces a alguien. ¿Qué signo te gustaría que fuera?', [ # these transitions are added at the bottom ], []) cancer = Node( 'Te ibas con esa persona pero se quedó llorando cuando escuchó La canción, así que llamaste a un taxi. Al llegar a tu casa te consigues un regalo:', [ Transition.simple( 'Abrir regalo', Node.leaf([ lambda bot, id_test: bot.send_message( id_test, 'https://www.youtube.com/watch?v=Uqg4Y6N53k0&') ])), ], []) leo = Node( 'Te ofreció la cola y te llevó hasta tu casa en un carro último modelo. Al llegar a tu casa te consigues un regalo:', [ Transition.simple( 'Abrir regalo', Node.leaf([ lambda bot, id_test: bot.send_message( id_test, 'https://www.youtube.com/watch?v=Uqg4Y6N53k0&') ])), ], [])
from graph import Node, Transition from perrito import perrito from signo import signo genero = Node('¿Qué género quieres escuchar mientras te arreglas?', [ Transition.with_actions('Reggaetón', perrito, ([lambda bot, id_test: bot.send_message(id_test, 'https://www.youtube.com/watch?v=-C8fmkL2cuI')]) ), Transition.with_actions('Hippie', signo, ([lambda bot, id_test: bot.send_message(id_test, 'https://youtu.be/0qkOtAzCJAs')]) ), Transition.with_actions('Funk', signo, ([lambda bot, id_test: bot.send_message(id_test, 'https://www.youtube.com/watch?v=zf4buOHOb-c')]) ), ], [ ])
from graph import Node, Transition from animal import animal from disco import disco normal_flow = Node( '¿Estás feliz o triste?', [Transition.simple('Feliz', disco), Transition.simple('Triste', animal)], []) password_node = Node( 'Solo la churra pasa. Ingresa la contraseña', [Transition('', lambda text: text == 'churra.21', normal_flow, [])], []) init_node = password_node
from graph import Node, Transition from museos import museo1, museo2, museo3, museo4, museo5 viaje = Node('¿A qué país quisieras ir?', [ Transition.with_actions('Italia', museo1, [lambda bot, id_test: bot.send_message(id_test, 'https://www.youtube.com/watch?v=nhdOMRyIPJg')] ), Transition.with_actions('Polonia', museo2, [lambda bot, id_test: bot.send_message(id_test, 'https://www.youtube.com/watch?v=iE4AZDDvxqE')] ), Transition.with_actions('Países Bajos', museo3, [lambda bot, id_test: bot.send_message(id_test, 'https://www.youtube.com/watch?v=kr4DNZz_8zI')] ), Transition.with_actions('Inglaterra', museo4, [lambda bot, id_test: bot.send_message(id_test, 'https://www.youtube.com/watch?v=vo-EsjZWqOE')] ), Transition.with_actions('Francia', museo5, [lambda bot, id_test: bot.send_message(id_test, 'https://www.youtube.com/watch?v=7bzliFUpceI')] ), ], [ ])
from graph import Node, Transition from util import asset_path vuelta_hotel = Node('Después de un largo día, vuelves al hotel y te consigues un regalo:', [ Transition.simple('Abrir regalo', Node.leaf( [lambda bot, id_test: bot.send_video(id_test, open(asset_path('gatico.mp4'), 'rb'), '')]) ), ], [ ])
from graph import Node, Transition from luz import luz from util import asset_path animal = Node('Entonces sal a pasear. Prefieres encontrarte un…', [ Transition.with_actions('Perro', luz, [ lambda bot, id_test: bot.send_photo( id_test, open(asset_path('corgi2.jpg'), 'rb'), 'Un corgi cumpleañero para otro corgi cumpleañero') ]), Transition.with_actions('Gato', luz, [ lambda bot, id_test: bot.send_audio( id_test, open(asset_path('Audio2.mp3'), 'rb'), '') ]), ], [])
from graph import Node, Transition from util import asset_path from genero import genero disco = Node('Decidiste ir a la disco. ¿Qué color de sombra usarías?', [ Transition.with_actions('Azul', genero, [ lambda bot, id_test: bot.send_message( id_test, 'https://twitter.com/VitaVirginiaBot/status/1167462809430630400?s=20' ) ]), Transition.with_actions('Rojo', genero, [ lambda bot, id_test: bot.send_message( id_test, 'https://www.poeticous.com/evaristo-carriego/el-clavel?locale=es') ]), Transition.with_actions('Negro', genero, [ lambda bot, id_test: bot.send_photo( id_test, open(asset_path('gatonegro.jpg'), 'rb'), '') ]), Transition.with_actions('Verde', genero, [ lambda bot, id_test: bot.send_message( id_test, 'https://www.desmos.com/calculator/x3vloqe7lq') ]), ], [])