Closed halid96 closed 1 year ago
it gives me the $member object, I can see the id, nickname, but roles are empty. I know the member has a lot of roles assigned...
$member
id
nickname
roles
I am using version 7.3... "team-reflex/discord-php": "^7.3",
"team-reflex/discord-php": "^7.3",
<?php use Discord\Builders\MessageBuilder; use Discord\Discord; use Discord\WebSockets\Event; use Discord\Parts\Interactions\Interaction; use Discord\Parts\User\Member; $discord = new Discord([ 'token' => Config::get_config('api_keys', 'BOT_TOKEN'), 'intents' => [ INTENTS::GUILD_MEMBERS ], 'loadAllMembers' => true ]); $discord->on('ready', function ($discord) { $discord->on(Event::GUILD_MEMBER_UPDATE, function (Member $member, Discord $discord, ?Member $oldMember) { print_r($member); }); }); $discord->run();
This is the result of the console output:
[nick] => iEatNailPaint🎅 [avatar] => [roles] => Discord\Helpers\Collection Object ( [] => Discord\Parts\Guild\Role Object ( [id] => [name] => [color] => [hoist] => [icon] => [unicode_emoji] => [position] => [permissions] => Discord\Parts\Permissions\RolePermission Object ( [create_instant_invite] => [manage_channels] => [view_channel] => [mention_everyone] => [manage_roles] => [add_reactions] => [send_messages] => [send_tts_messages] => [manage_messages] => [embed_links] => [attach_files] => [read_message_history] => [use_external_emojis] => [manage_webhooks] => [use_application_commands] => [manage_threads] => [create_public_threads] => [create_private_threads] => [use_external_stickers] => [send_messages_in_threads] => [priority_speaker] => [stream] => [connect] => [speak] => [mute_members] => [deafen_members] => [move_members] => [use_vad] => [manage_events] => [start_embedded_activities] => [request_to_speak] => [kick_members] => [ban_members] => [administrator] => [manage_guild] => [view_audit_log] => [view_guild_insights] => [change_nickname] => [manage_nicknames] => [manage_emojis_and_stickers] => [moderate_members] => [bitwise] => 0 ) [managed] => [mentionable] => [tags] => [guild_id] => ) ) [joined_at] => 2022-07-27T19:32:41Z [premium_since] => [deaf] => [mute] =>
try with 'intents' =>Intents::getDefaultIntents() | Intents::GUILD_MEMBERS
it gives me the
$member
object, I can see theid
,nickname
, butroles
are empty. I know the member has a lot of roles assigned...I am using version 7.3...
"team-reflex/discord-php": "^7.3",
This is the result of the console output: