@Bot.event
async def on_voice_state_update(member, before, after):
if after.channel != None:
if after.channel.id == 843730990408007698:
for guild in Bot.guilds:
maincategory = discord.utils.get(guild.categories, id=848659633664032829)
channel2 = await guild.create_voice_channel( name = f' || { member.display_name }', category = maincategory )
await channel2.set_permissions(member, connect = True)
await member.move_to(channel2)
#if after.channel is None and len(channel2.members) == 0:
def check(x,y,z):
return len(channel2.members) == 0
await Bot.wait_for('voice_state_update',check=check)
await channel2.delete()
Ignoring exception in on_voice_state_update
Traceback (most recent call last):
File "C:\Users\maksm\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\maksm\Desktop\proj\bot.py", line 498, in on_voice_state_update
await channel2.set_permissions(member, connect = True)
File "C:\Users\maksm\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\abc.py", line 667, in set_permissions
await http.edit_channel_permissions(self.id, target.id, allow.value, deny.value, perm_type, reason=reason)
File "C:\Users\maksm\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\http.py", line 250, in request
raise NotFound(r, data)
discord.errors.NotFound: 404 Not Found (error code: 10009): Unknown Overwrite
for guild in Bot.guilds:
maincategory = discord.utils.get(guild.categories, id=848659633664032829)
@Bot.event
async def on_voice_state_update(member, before, after):
if after.channel != None:
if after.channel.id == 843730990408007698:
category = after.channel.category
channel2 = await member.guild.create_voice_channel(
name = f' || { member.display_name }',
category = category
)
await channel2.set_permissions(member, connect = True)
await member.move_to(channel2)
def check(x, y, z): return len(channel2.members) == 0
await Bot.wait_for('voice_state_update', check = check)
await channel2.delete()