Changeset 69dd60c in python-cinema-club-bot for commands/movie.py
- Timestamp:
- Oct 11, 2024, 1:53:24 AM (5 weeks ago)
- Branches:
- master
- Children:
- ac7b16a
- Parents:
- 694d823
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
commands/movie.py
r694d823 r69dd60c 14 14 from imdb import Cinemagoer 15 15 16 from utils import context_init, choose_next_user 17 from predicates import has_finished_event 16 from utils import context_init, choose_next_user, normalize_username, \ 17 init_new_event 18 from predicates import has_finished_movie 18 19 from strings import MOVIE_NOT_PROVIDED, EXPECTED_ONE_MOVIE, \ 19 20 MOVIE_ANOTHER_USER, FETCHING_MOVIE, FETCHING_ERROR, \ … … 38 39 username = update.message.from_user.username 39 40 40 if has_finished_event(context, chooser): 41 users = context.chat_data["users"] = choose_next_user(users) 42 raise error.TelegramError(MOVIE_ANOTHER_USER.format(users[0])) 41 if has_finished_movie(context): 42 users = context.chat_data["users"] = choose_next_user(context) 43 43 44 44 if "@"+username != chooser: … … 64 64 id=movie.getID(), 65 65 user=update.effective_user.username, 66 poster=movie.data.get("cover url"),67 66 rating=movie.data.get("rating"), 68 67 genres=movie.data.get("genres"), … … 81 80 context.chat_data["events"][-1] = last_event 82 81 else: 82 init_new_event(context, users[0], movie_dict["title"]) 83 83 context.chat_data["movies"].append(movie_dict) 84 84 … … 101 101 movies_formatted += MOVIES_LIST.format( 102 102 title=movie["title"], 103 id=movie["id"],104 103 user=movie["user"] 105 104 )
Note:
See TracChangeset
for help on using the changeset viewer.