Не меняется статус бота | Discord.py

@bot.event
async def on_ready():
     while True:
         time = str(datetime.datetime.now().time().hour) + ':' + str(datetime.datetime.now().time().minute)
         await bot.change_presence(status=discord.Status.online, activity=discord.Game(f"-help | {time}"))
         await sleep(5)
         await bot.change_presence(status=discord.Status.idle, activity=discord.Game(f"{len(set(bot.get_all_channels()))} каналов"))
         await sleep(5)
         await bot.change_presence(status=discord.Status.dnd, activity=discord.Game(f"{len(bot.guilds)} серверов! | {len(set(bot.get_all_members()))} участников"))
         await sleep(5)

При этом, в интерпретаторе отсутствуют какие-либо ошибки.



Ответы (1 шт):

Автор решения: xZartsust

Вот 100% рабочий код:

async def change_status():
    await bot.wait_until_ready()
    msg = cycle(status)

    while not bot.is_closed():
        next_status = next(msg)
        await bot.change_presence(activity = discord.Game(name = next_status))
        await asyncio.sleep(9)
status = ['статус1', 'статус2']
→ Ссылка