Spaces:
Runtime error
Runtime error
Create callbacks.py
Browse files- bot/ui/callbacks.py +11 -0
bot/ui/callbacks.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PATH: bot/ui/callbacks.py
|
| 2 |
+
# small + safe callback format
|
| 3 |
+
# example: "setdef:<profile_id>"
|
| 4 |
+
def set_default_cb(profile_id: str) -> str:
|
| 5 |
+
return f"setdef:{profile_id}"
|
| 6 |
+
|
| 7 |
+
def parse_cb(data: str) -> tuple[str, str]:
|
| 8 |
+
if ":" not in data:
|
| 9 |
+
return data, ""
|
| 10 |
+
a, b = data.split(":", 1)
|
| 11 |
+
return a, b
|