Function with Event GUILD_MEMBER_ADD #1179
-
Hello, It's my first intervention in github. If any information is missing, please let me know. I want to create a DM when a user join the guild (it's a training). This is my code : $discord->on(Event::GUILD_MEMBER_ADD, function (Member $member, Discord $discord) {
}); I've been through a lot of issues about the GUILD_MEMBER_ADD but it still doesn't work for me. On my developper panel, I checked the permission "SERVER_MEMBER_INTENT" and my bot is administrator of the server. When I watch the service log when user join the guild, nothing at all. I'have testing with Event::message and it's working. Can you help me about this problem ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
have you done this as well? use Discord\Discord;
use Discord\WebSockets\Intents;
$discord = new Discord([
'token' => 'xxx',
'intents' => Intents::getDefaultIntents() | Intents::GUILD_MEMBERS,
]); |
Beta Was this translation helpful? Give feedback.
have you done this as well?