}
if (!empty($player['discordTag'])) {
$tag = explode('#', $player['discordTag']);
- $user = User::firstWhere([
- ['username', 'LIKE', $tag[0]],
- ['discriminator', '=', $tag[1]],
- ]);
+ $user = count($tag) < 2 || $tag[1] == '0'
+ ? User::firstWhere([
+ ['username', 'LIKE', $tag[0]],
+ ])
+ : User::firstWhere([
+ ['username', 'LIKE', $tag[0]],
+ ['discriminator', '=', $tag[1]],
+ ]);
if ($user) return $user;
}
return null;
const content = <>
<img alt="" src={getAvatarUrl(user)} />
<span>{discriminator || !user.nickname ? user.username : user.nickname}</span>
- {discriminator ?
+ {discriminator && user.discriminator ?
<span className="text-muted">
{'#'}
{user.discriminator}