mirror of
https://github.com/the-programmers-hangout/Hermes.git
synced 2026-09-09 16:06:23 +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) {
|
foreach ($guild->emojis as $emoji) {
|
||||||
$type = $emoji->animated ? 'ANIMATED' : 'STATIC';
|
$emote = \App\Models\Emote::where('emote_id', $emoji->id)->whereIn('type', ['ANIMATED', 'STATIC'])->whereNull('image')->first();
|
||||||
$emote = \App\Models\Emote::where('emote_id', $emoji->id)->where('type', $type)->whereNull('image')->first();
|
|
||||||
if (! $emote) {
|
if (! $emote) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ext = $emoji->animated ? 'gif' : 'png';
|
$ext = $emote->type === 'ANIMATED' ? 'gif' : 'png';
|
||||||
$url = "https://cdn.discordapp.com/emojis/{$emoji->id}.{$ext}";
|
$url = "https://cdn.discordapp.com/emojis/{$emoji->id}.{$ext}";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -41,6 +40,7 @@ class UpdateEmoteImages extends Service
|
|||||||
$emote->save();
|
$emote->save();
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
$this->console()->log("Failed to fetch image for emote ID {$emoji->id}: ".$e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user