Example #1
0
async def get_data(dialog_manager: DialogManager, **kwargs):
    return {
        "name": "Tishka17",
        "age": 19,
        "now": datetime.now().time().strftime("%H:%M:%S"),
        "progress": dialog_manager.current_context().dialog_data.get("progress", 0),
        "progress2": dialog_manager.current_context().dialog_data.get("progress2", 0),
    }
Example #2
0
async def get_data(dialog_manager: DialogManager, **kwargs):
    return {
        "stack": dialog_manager.current_stack(),
        "context": dialog_manager.current_context(),
        "now": datetime.datetime.now(),
        "counter":
        dialog_manager.current_context().dialog_data.get("counter", 0),
        "fruits": [
            ("Apple", 1),
            ("Pear", 2),
            ("Orange", 3),
            ("Banana", 4),
        ]
    }
Example #3
0
async def get_data2(dialog_manager: DialogManager, **kwargs):
    return {
        "text": dialog_manager.current_context().start_data,
        "now": datetime.now().isoformat(),
    }
Example #4
0
async def on_input(m: Message, dialog: Dialog, manager: DialogManager):
    manager.current_context().dialog_data["name"] = m.text
    await dialog.next(manager)  # rendering tool cannot detect this call
Example #5
0
async def on_click(c: CallbackQuery, button: Button, manager: DialogManager):
    counter = manager.current_context().dialog_data.get("counter", 0)
    manager.current_context().dialog_data["counter"] = counter + 1
Example #6
0
async def get_bg_data(dialog_manager: DialogManager, **kwargs):
    return {
        "progress":
        dialog_manager.current_context().dialog_data.get("progress", 0)
    }
Example #7
0
async def on_input(m: Message, dialog: Dialog, manager: DialogManager):
    manager.current_context().dialog_data["name"] = m.text
    await dialog.next(manager)