I am using Discord.py for my bot and this error occurs:
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 4008 (private use), reason = Rate limited.
It happens when I use this:
while true:
activity=discord.Game(name=f"some stuff")
await client.change_presence(activity=activity, status=status)
It is in an async function, so it is not related to async/await usage.