From 662342863e37e8661f818218df7bb72bc18bf4eb Mon Sep 17 00:00:00 2001 From: Mikhail Kirillov Date: Wed, 9 Oct 2024 04:53:26 +0400 Subject: Add movies commands --- utils.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'utils.py') 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) + "`" -- cgit v1.2.3