From 7da393f01c80343dca3e3e5fe19984599da0eedf Mon Sep 17 00:00:00 2001 From: luk3yx Date: Mon, 19 Dec 2022 19:04:02 +1300 Subject: [PATCH] Fix some bugs with send_every_3s --- server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 8fadcd8..de7cadc 100644 --- a/server.py +++ b/server.py @@ -219,13 +219,14 @@ async def send_messages(): to_send = [] msglen = 0 - while incoming_msgs and msglen + len(incoming_msgs[0]) < 1999: + while incoming_msgs and msglen + len(incoming_msgs[0]) <= 2000: msg = incoming_msgs.popleft() to_send.append(msg) msglen += len(msg) + 1 try: - await channel.send('\n'.join(to_send)) + await asyncio.wait_for(channel.send('\n'.join(to_send)), + timeout=10) except Exception: traceback.print_exc()