Changeset 6623428 in python-cinema-club-bot for utils.py


Ignore:
Timestamp:
Oct 9, 2024, 10:46:19 PM (5 weeks ago)
Author:
Mikhail Kirillov <w96k@…>
Branches:
master
Children:
9be02d9
Parents:
0d48ea2
git-author:
Mikhail Kirillov <w96k@…> (10/09/24 04:53:26)
git-committer:
Mikhail Kirillov <w96k@…> (10/09/24 22:46:19)
Message:

Add movies commands

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utils.py

    r0d48ea2 r6623428  
    1414
    1515def context_init(context: ContextTypes.DEFAULT_TYPE):
    16     '''
     16    """
    1717    Initialize chat context with starting values
    18     '''
     18    """
    1919
    2020    if "users" not in context.chat_data:
    2121        context.chat_data["users"]: list[str] = []
    2222
     23    if "movies" not in context.chat_data:
     24        context.chat_data["movies"]: list[dict] = []
     25
    2326    return context
     27
     28
     29def normalize_username(username: str):
     30    return username.replace("@", "")
     31
     32
     33def create_users_string(users: list[str]) -> str:
     34    return "`" + ", ".join(users) + "`"
Note: See TracChangeset for help on using the changeset viewer.