]> git.localhorst.tv Git - alttp.git/commitdiff
also sync discord username/discriminator
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 28 Jul 2023 09:31:15 +0000 (11:31 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 28 Jul 2023 09:31:15 +0000 (11:31 +0200)
app/DiscordBotCommands/SyncUserCommand.php

index 520565ce9ffa810448cc6bb916789febbdb40ec7..642c8c756f42b280af537758c0aa8230f44a2911 100644 (file)
@@ -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')) {