summaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
authorMikhail Kirillov <w96k@runbox.com>2024-10-09 04:53:26 +0400
committerMikhail Kirillov <w96k@runbox.com>2024-10-09 22:46:19 +0400
commit662342863e37e8661f818218df7bb72bc18bf4eb (patch)
tree79ff9b3884a36e7afec820a8b7c3f235f2e6f1f1 /utils.py
parent0d48ea28aeb8a6290d2aeab202efa9c8d6e30fe3 (diff)
Add movies commands
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/utils.py b/utils.py
index 4b28c03..93ad3ed 100644
--- a/utils.py
+++ b/utils.py
@@ -13,11 +13,22 @@ from telegram.ext import ContextTypes
def context_init(context: ContextTypes.DEFAULT_TYPE):
- '''
+ """
Initialize chat context with starting values
- '''
+ """
if "users" not in context.chat_data:
context.chat_data["users"]: list[str] = []
+ if "movies" not in context.chat_data:
+ context.chat_data["movies"]: list[dict] = []
+
return context
+
+
+def normalize_username(username: str):
+ return username.replace("@", "")
+
+
+def create_users_string(users: list[str]) -> str:
+ return "`" + ", ".join(users) + "`"