Closed gregorst3 closed 2 years ago
finished
Hi @vicalloy I'm also interested in this feature. After updating the code, its running but it doesn't split the message. I've tested both versions, before and after the changes but the outcome is the same (half of the output is lost)
could you check again?
Thanks for your time
Here some test results to prove what I'm saying. As you can see, telegram-shell-bot only sends one message of lenght MAX_TASK_OUTPUT=500, i can increase that to 4096 but that is still less than the total output. The splitting is not happening.
while the benchmark does the spliting:
Thank you
@guerman5 fixed. telegram's max length is 4096 bytes. Python's len() is by char.
Hi @vicalloy , I appreciate your attention :)
max_length = constants.MAX_MESSAGE_LENGTH // 2 while msg: message.reply_text(msg[:max_length], *args, **kwargs) msg = msg[max_length:]
My tests results are not successful :S
I confirm the new code is running as before,
The message
is not being split by consecutive msg
of max_length
. Seems it is only sending the first msg
of "MAX_TASK_OUTPUT", 500
.
cat /home/user/10K_lines.txt
I can increase that 500 in settings.py (to 2000 for example below), but it just increases the first msg
lenght, yet the split wont happen.
Reference, using same file 10K_lines.txt:
@guerman5
If you want output all message MAX_TASK_OUTPUT
should set to a huge number ex: 999999
.
By default, bot will only send first 3s message.
If you want output all message, you should add oa;
.
ex: oa;cat poetry.lock
Hello, I have a script with long output, for the limitations imposed, some part of my script's output get lost. Is it possible to do something like this? https://github.com/python-telegram-bot/python-telegram-bot/issues/768#issuecomment-368349130