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

Titles plot fails for some image dimensions #16

Open
mkdryden opened this issue Dec 19, 2022 · 0 comments
Open

Titles plot fails for some image dimensions #16

mkdryden opened this issue Dec 19, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@mkdryden
Copy link
Owner

Apparently /stats titles fails for chats with a small number of titles, resulting in a weird shaped image:

telegram-stats-bot_1  | Traceback (most recent call last):
telegram-stats-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/ext/utils/promise.py", line 96, in run
telegram-stats-bot_1  |     self._result = self.pooled_function(*self.args, **self.kwargs)
telegram-stats-bot_1  |   File "/usr/src/app/telegram_stats_bot/main.py", line 173, in print_stats
telegram-stats-bot_1  |     context.bot.send_photo(chat_id=update.effective_chat.id, photo=image)
telegram-stats-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/bot.py", line 134, in decorator
telegram-stats-bot_1  |     result = func(*args, **kwargs)
telegram-stats-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/bot.py", line 753, in send_photo
telegram-stats-bot_1  |     return self._message(  # type: ignore[return-value]
telegram-stats-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/ext/extbot.py", line 203, in _message
telegram-stats-bot_1  |     result = super()._message(
telegram-stats-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/bot.py", line 344, in _message
telegram-stats-bot_1  |     result = self._post(endpoint, data, timeout=timeout, api_kwargs=api_kwargs)
telegram-stats-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/bot.py", line 299, in _post
telegram-stats-bot_1  |     return self.request.post(
telegram-stats-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/utils/request.py", line 359, in post
telegram-stats-bot_1  |     result = self._request_wrapper('POST', url, fields=data, **urlopen_kwargs)
telegram-stats-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/utils/request.py", line 279, in _request_wrapper
telegram-stats-bot_1  |     raise BadRequest(message)
telegram-stats-bot_1  | telegram.error.BadRequest: Photo_invalid_dimensions
@mkdryden mkdryden added the bug Something isn't working label Dec 19, 2022
@mkdryden mkdryden self-assigned this Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant