ksubot.py: Increase timeout (#589)

Increase the timeout duration and try to resolve the
'telegram.error.TimedOut: Timed out' issue when sending messages in a
Telegram group.
This commit is contained in:
Womsxd
2023-06-04 23:31:37 +08:00
committed by GitHub
parent 670a20c37f
commit 05c6892f43

View File

@@ -82,7 +82,7 @@ async def main():
print("[-] File not exist: " + one) print("[-] File not exist: " + one)
continue continue
print("[+] Upload: " + one) print("[+] Upload: " + one)
msg = await bot.send_document(CACHE_CHAT_ID, one) msg = await bot.send_document(CACHE_CHAT_ID, one, write_timeout=60, connect_timeout=30)
if one == paths[-1]: if one == paths[-1]:
files.append(telegram.InputMediaDocument(msg.document, files.append(telegram.InputMediaDocument(msg.document,
caption=caption, caption=caption,