Пишу бота, и не могу исправить это, помогите, вот код и сама ошибка:
channel_chat = client.get_channel(879035346015359023)
message = await channel_chat.send(embed = discord.Embed(title="Внимание! Идёт установка ролей..", description="Ожидайте...", colour=discord.Colour.from_rgb(255, 0, 0)))
getrole = discord.utils.get(ctx.guild.roles, id=879035345969217558)
guild = ctx.guild
for member in guild:
if role not in member.roles:
await member.add_roles(getrole)
await message.edit(embed = discord.Embed(title="Установка завершилась!",description=f"Ролей выдано :: {ctx.guild.member_count}", colour=discord.Colour.from_rgb(0, 255, 0)))
await message.add_reaction("✅")
return
return
Ошибка:
Ignoring exception in command setup_roles:
Traceback (most recent call last):
File "C:\Users\Asus\AppData\Local\Programs\Python\Python39\lib\site-packages\discord.py-0.16.3-py3.9.egg\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\Asus\Desktop\GGDPS Manager\bot.py", line 21, in setup_roles
for member in guild:
TypeError: 'Guild' object is not iterable
The above exception was the direct cause of the following exception: