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 1 commit
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
8 changes: 4 additions & 4 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 @@ -252,8 +253,9 @@ async def get_most_shared_meme_report(user_id, limit=10):
"type": meme_data["type"],
"telegram_file_id": meme_data["telegram_file_id"],
"caption": f"""
Твои друзья больше всего орнули с этого мема 🤦‍♂️\n\n{meme_data["caption"]}
""",
Твои друзья больше всего орнули с этого мема 🤦‍♂️{
('\n\n' + meme_data["caption"]) if meme_data["caption"] is not None else ''
}""",
}


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