From: Daniel Karbach Date: Fri, 28 Jul 2023 09:31:15 +0000 (+0200) Subject: also sync discord username/discriminator X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=a6ae4c17a843b876fb7bf552577a76b79645d55b;p=alttp.git also sync discord username/discriminator --- diff --git a/app/DiscordBotCommands/SyncUserCommand.php b/app/DiscordBotCommands/SyncUserCommand.php index 520565c..642c8c7 100644 --- a/app/DiscordBotCommands/SyncUserCommand.php +++ b/app/DiscordBotCommands/SyncUserCommand.php @@ -29,6 +29,10 @@ class SyncUserCommand extends BaseCommand { $user->mfa_enabled = $discordUser->mfaenabled ?: false; } $user->avatar = $discordUser->avatarhash ?: null; + if ($user->username != $discordUser->username) { + $user->username = $discordUser->username; + $user->discriminator = $discordUser->discriminator; + } $media = Storage::disk('media'); if ($user->avatar && $media->missing('avatar/'.$user->id.'/'.$user->avatar.'.png')) {