mirror of
https://github.com/the-programmers-hangout/Hermes.git
synced 2026-09-04 01:06:00 +02:00
log when saving emote images
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user