teamreflex / oauth2-discord

OAuth2 client for authenticating with the Discord API servers
MIT License
61 stars 26 forks source link

Userclass not found #24

Open GRX opened 6 years ago

GRX commented 6 years ago

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!