Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix meme caption showing in ffmemes wrapped #59

Merged
merged 3 commits into from
Mar 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/tgbot/handlers/stats/wrapped.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ async def generate_user_wrapped(user_id: int, update: Update):
А ну-ка смотреть мемусики: /start
"""
)
return

await msg.edit_text("⏳")
most_shared_meme_report = await get_most_shared_meme_report(user_id)
Expand Down Expand Up @@ -247,13 +248,14 @@ async def get_most_shared_meme_report(user_id, limit=10):
shared_meme_id = shared_memes[0]["meme_id"]
meme_data = await get_meme_by_id(shared_meme_id)
if meme_data:
caption = """Твои друзья больше всего орнули с этого мема 🤦‍♂️"""
if meme_data["caption"] is not None:
caption += "\n\n" + meme_data["caption"]
return {
"id": meme_data["id"],
"type": meme_data["type"],
"telegram_file_id": meme_data["telegram_file_id"],
"caption": f"""
Твои друзья больше всего орнули с этого мема 🤦‍♂️\n\n{meme_data["caption"]}
""",
"caption": caption,
}


Expand Down Expand Up @@ -291,8 +293,6 @@ async def get_humor_report(user_id):

result = await call_chatgpt(PROMPT)

# TODO: call chatGPT

REPORT = f"""
Я посмотрел на твои лайки и немножко понял твое чувство юмора:

Expand Down
Loading