YouTubeLoader / bot /ui /callbacks.py
understanding's picture
Create callbacks.py
69f1c1d verified
raw
history blame
308 Bytes
# PATH: bot/ui/callbacks.py
# small + safe callback format
# example: "setdef:<profile_id>"
def set_default_cb(profile_id: str) -> str:
return f"setdef:{profile_id}"
def parse_cb(data: str) -> tuple[str, str]:
if ":" not in data:
return data, ""
a, b = data.split(":", 1)
return a, b