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 error: "Bad Request: message text is empty" #5

Merged
merged 1 commit into from
Dec 25, 2023

Conversation

ShrirajHegde
Copy link
Contributor

Some prompts generate output with no response data in the very beginning. This creates an empty full_response_stripped string, which makes aiogram throw aiogram.exceptions.TelegramBadRequest: Telegram server says - Bad Request: message text is empty.

An easy fix is to monitor for empty full_response_stripped variable with:

            if full_response_stripped == "":
                continue

Some prompts generate output with no response data in the very beginning. This creates an empty `full_response_stripped` string, which makes aiogram throw `aiogram.exceptions.TelegramBadRequest: Telegram server says - Bad Request: message text is empty`.

An easy fix is to monitor for empty `full_response_stripped` variable with:
```python
            if full_response_stripped == "":
                continue
```
@ruecat ruecat merged commit 2472468 into ruecat:main Dec 25, 2023
@ruecat
Copy link
Owner

ruecat commented Dec 25, 2023

Thanks for the PR!

@ShrirajHegde ShrirajHegde deleted the patch-1 branch January 9, 2024 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants