@bot.event
async def on_member_join(member):
if role := member.guild.get_role(418187634689139935):
await member.add_roles(role)
@bot.command()
async def я(ctx, *, message):
member = message.author
role = discord.utils.get(lambda role: role.name == "Игрок", ctx.guild.roles)
await member.add_roles(role)
if role := member.guild.get_role(418187634689139935):
async def on_member_join(member):
role = discord.utils.get(member.guild.roles, name="Имя роли") #или id = role_id
await member.add_roles(role)