import disnake
import os
from disnake.ext import commands
class Welcome(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_member_join(self, member):
channel_age = self.bot.get_channel(1081301042140037282)
role = await disnake.utils.get(guild_id=member.guild.id, role_id=1081480602408189992)
embed = disnake.Embed(
title=f"{member.name} добро пожаловать на сервер!",
description=f"{member.guild.name} приветствует тебя!"
).set_thumbnail(url=member.avatar)
await channel_age.send(embed=embed)
await member.add_roles(role)
def setup(bot):
bot.add_cog(Welcome(bot))
Ignoring exception in on_member_join
Traceback (most recent call last):
File "C:\bot\venv\lib\site-packages\disnake\client.py", line 705, in _run_event
await coro(*args, **kwargs)
File "c:\bot\cogs\welcome.py", line 12, in on_member_join
role = await disnake.utils.get(guild_id=member.guild.id, role_id=1081480602408189992)
TypeError: get() missing 1 required positional argument: 'iterable'