From 723c9cf599ab8d9017bd7a2d65922e94d2a9dd46 Mon Sep 17 00:00:00 2001 From: itsAzaria Date: Thu, 19 Feb 2026 23:03:33 +0000 Subject: [PATCH] log when saving emote images --- app/Services/UpdateEmoteImages.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Services/UpdateEmoteImages.php b/app/Services/UpdateEmoteImages.php index c0ad483..87a4544 100644 --- a/app/Services/UpdateEmoteImages.php +++ b/app/Services/UpdateEmoteImages.php @@ -23,13 +23,12 @@ class UpdateEmoteImages extends Service } foreach ($guild->emojis as $emoji) { - $type = $emoji->animated ? 'ANIMATED' : 'STATIC'; - $emote = \App\Models\Emote::where('emote_id', $emoji->id)->where('type', $type)->whereNull('image')->first(); + $emote = \App\Models\Emote::where('emote_id', $emoji->id)->whereIn('type', ['ANIMATED', 'STATIC'])->whereNull('image')->first(); if (! $emote) { continue; } - $ext = $emoji->animated ? 'gif' : 'png'; + $ext = $emote->type === 'ANIMATED' ? 'gif' : 'png'; $url = "https://cdn.discordapp.com/emojis/{$emoji->id}.{$ext}"; try { @@ -41,6 +40,7 @@ class UpdateEmoteImages extends Service $emote->save(); } } catch (\Exception $e) { + $this->console()->log("Failed to fetch image for emote ID {$emoji->id}: ".$e->getMessage()); } } }