Closed nouman0103 closed 3 years ago
For a temporary fix, I had to modify the client.py
to count the time taken in while loop:
from time import time
import asyncio
#.....
#...
timer = timeout
t = time()
while True:
timer -= time()-t
if timer <= 1:raise asyncio.TimeoutError()
res = await self.bot.wait_for("socket_response", check=check, timeout=timer)
#.....
Edit: It is kinda broken when there are plenty of responses
I had to remove the while loop and make those if
statements default check: (Might be a little dumb, but I had no time to make it a separate function in class and pass that as default check)
#....
def default_check(res):
if res["t"] != "INTERACTION_CREATE":
return False
if message.id != int(res["d"]["message"]["id"]):
return False
return True
res = await self.bot.wait_for("socket_response", check=default_check, timeout=timeout)
#....
Fixed on 0.5.0
The title says it all. Seems like it loops through
wait_for
with that timeout, so each time a non relevant interaction occurs, the timeout kinda resets.