@client.event
async def update_online():
online_now = sum([0 if member.status == discord.status.offline else 1 for member in after.guild.members])
channel = bot.get_channel(806502570696376390)
await channel.edit(name=f"ONLINE: {online_now}")
on_
on_update_online()
не существует, вам нужен on_member_update(before, after)
: https://discordpy.readthedocs.io/en/stable/api.htm...from datetime import datetime
...
last_time = datetime.now()
@client.event
async def on_member_update(before, after):
if (datetime.now() - last_time).total_seconds() > 60*5: # один раз в пять минут
return
last_time = datetime.now()
online = len([m for m in after.guild.members if m.status != discord.Status.offline])
await bot.get_channel(CHANNEL_ID).edit(name=f"Online: {online}")