Skip to content

Commit

Permalink
Update mapUserToObject to accept discriminator as string (#98)
Browse files Browse the repository at this point in the history
mapUserToObject function was removing the leading 0 from username "%s#%d" because it was being seen as an integer rather than a string.
  • Loading branch information
ChachoJones authored and faustbrian committed Aug 28, 2017
1 parent 336ced2 commit f934ca3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function mapUserToObject(array $user)
{
return (new User())->setRaw($user)->map([
'id' => $user['id'],
'nickname' => sprintf('%s#%d', $user['username'], $user['discriminator']),
'nickname' => sprintf('%s#%s', $user['username'], $user['discriminator']),
'name' => $user['username'],
'email' => $user['email'],
'avatar' => (is_null($user['avatar'])) ? null : sprintf('https://cdn.discordapp.com/avatars/%s/%s.jpg', $user['id'], $user['avatar']),
Expand Down

0 comments on commit f934ca3

Please sign in to comment.