import discord
from discord.ext import commands
TOKEN = settings ['token']
bot = commands.Bot (command_prefix = settings ['prefix'])
@bot.event
async def on_member_join (member):
print(f'Присоединился {member.user}')
await member.send("Hi!")
bot.run (TOKEN)
on_member_join
требует members intent: https://discordpy.readthedocs.io/en/stable/api.htm...intents
в конструктор бота:intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(..., intents=intents)