teamreflex/oauth2-discord

Userclass not found

GRX opened this issue · 0 comments

GRX commented

Hi There,

I keep getting the following error when I try to access the user object.
PHP Fatal error: Uncaught Error: Class 'Discord\\OAuth\\Parts\\User' not found in ...

I copied the code directly from the example;

$refresh = $provider->getAccessToken('refresh_token', [
	'refresh_token' => $token->getRefreshToken(),
]);
echo pre_dump('Refresh Token',$refresh);

// Get the user object.
$user = $provider->getResourceOwner($token);
echo pre_dump($user);

$connections = $user->connections;
echo pre_dump('Connections',$connections);

// Get the guilds and connections.
$guilds = $user->guilds;
echo pre_dump('Guilds (and connections?)',$guilds);

But it stops at $user = $provider->getResourceOwner($token);

Am I missing resources or something?
Thank you in advance!