Нужно исправить ошибку, в питоне я новичок
Код от которого идёт проблема:
@client.command(name='dsc')
async def _dsc(ctx, cname: str = None):
cccname = cname
for c in discord.utils.get(ctx.guild.channels, name=cccname):
await c.delete()
Ошибка:
Ignoring exception in command dsc:
Traceback (most recent call last):
File "/home/darknessyt/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "/home/darknessyt/discord-bot/python/src/bot/core.py", line 311, in _dsc
for c in discord.utils.get(ctx.guild.channels, name=cccname):
TypeError: 'VoiceChannel' object is not iterable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/darknessyt/.local/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "/home/darknessyt/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 859, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/darknessyt/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'VoiceChannel' object is not iterable