diff --git a/public/index.php b/public/index.php index e17734b..6eab68a 100644 --- a/public/index.php +++ b/public/index.php @@ -129,12 +129,12 @@ if(!empty($_GET['common'])) { if(isset($soundInfo->sources->mp3)) $config['soundFiles'][strtr($soundInfo->name, [':' => '_', '-' => '_'])] = $soundInfo->sources->mp3; - $emotesUrl = 'https:' . $common->emotes; + $emotesUrl = 'https:' . $common->api . '/v1/emotes'; $emotes = json_decode(file_get_contents($emotesUrl)); foreach($emotes as $emoteInfo) - if($emoteInfo->Hierarchy < 1) { - $config['emoticonCodes'][] = $emoteInfo->Text[0]; - $config['emoticonFiles'][] = $emoteInfo->Image; + if(empty($emoteInfo->min_rank)) { + $config['emoticonCodes'][] = sprintf(':%s:', $emoteInfo->strings[0]); + $config['emoticonFiles'][] = str_starts_with($emoteInfo->url, 'https:') ? substr($emoteInfo->url, 6) : $emoteInfo->url; } header('Content-Type: application/javascript; charset=utf-8');