Answer the question
In order to leave comments, you need to log in
The category name is not updated, how to fix it?
Good day, I have a piece of code:
@client.event
async def on_voice_state_update(member, before, after):
channel = client.get_channel(908270672290132002)
members = channel.members
memids = []
category = client.get_channel(908270672290132000)
for member in members:
memids.append(member.id)
count = len(memids)
await category.edit(name = str(count))
Answer the question
In order to leave comments, you need to log in
And why do you update constantly for each user? Someone entered / left, took the number of participants, entered it in the name of the channel
@client.event
async def on_voice_state_update(member, before, after):
members_count = len(client.get_channel(908270672290132002).members)
client.get_channel(908270672290132000).edit(name = str(members_count))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question