discord python. не работает on_member_join

Никак не реагирует на присоединение пользователя на сервер(будто просто игнорирует команду)

import discord
from discord.ext import commands
config = {
    'token': 'token',
    'prefix': '!+',
}

bot = commands.Bot(command_prefix=config['prefix'])

# playing status
@bot.event
async def on_ready():
    activity = discord.Game(name='Management', type=3)
    await bot.change_presence(status=discord.Status.idle, activity=activity)
    print('Bot is ready!')

@bot.event # не работает
async def on_member_join(member):
    print('joined a server')

bot.run(config['token'])


Ответы (1 шт):

Автор решения: Corrygan

Нужно включить интенты в начале кода:

bot = commands.Bot(command_prefix=config['prefix'], intents=discord.Intents.all())

Также на портале разработчика(https://discord.com/developers/applications/ид_бота/bot) нужно также включить member.intents и presence.intents во вкладке Bot

→ Ссылка