pycord icon indicating copy to clipboard operation
pycord copied to clipboard

Bot not switching to "ready" after reconnect.

Open Miolus opened this issue 4 years ago • 3 comments

Summary

After a reconnect to the gateway, bot.is_ready() will always return False.

Reproduction Steps

Create a bot that displays the ready state in his status.

Minimal Reproducible Code

bot = discord.Bot()
from discord.ext.tasks import loop

@bot.event 
async def on_connect():
    presence_manager.start()


@loop(seconds=300)
async def presence_manager():
     if not bot.is_ready():
        presence="Loading."
    else:
        presence="Ready."
    game = discord.Game(presence)
    await bot.change_presence(status=discord.Status.online, activity=game)

Expected Results

Display "Ready." in status after reconnecting.

Actual Results

Status stays "Loading." after reconnecting.

Intents

members

System Information

pycord 2.0.0b4 python3.9

Checklist

  • [X] I have searched the open issues for duplicates.
  • [X] I have shown the entire traceback, if possible.
  • [X] I have removed my token from display, if visible.

Additional Context

No response

Miolus avatar Feb 16 '22 15:02 Miolus

Presence most likely isn't updating, printing the result of is_ready would be a more reliable method to check.

plun1331 avatar Feb 16 '22 15:02 plun1331

I've just build this method to show it, there are other methods checking is_ready in my bot.

Miolus avatar Feb 16 '22 16:02 Miolus

Switched sharding to 5 shards / proc, can't repro anymore.

Miolus avatar Mar 04 '22 09:03 Miolus