Closed cemalct closed 1 year ago
is the bot only in one guild and you made $guild being globally available in your entire script?
Yes, also guild is already loaded with server's id. $guild retrieves everything related with that server, but can't use member.
get on https://discord.gg/dphp #discordphp
The answer is to use $interaction->member
$member = $guild->members->get('id', $interaction['user']->id);
While $guild returns the entire guild, can't get information related with member. Imported Discord\Parts\User\Member, still not working. The event I'm trying to get member;
$discord->on(Event::INTERACTION_CREATE, function (Interaction $interaction, Discord $discord) use ($guild)