* #include * ``` */ namespace unicode_emoji { END; /* This JSON is generated originally via the NPM package maintained by Discord themselves at https://www.npmjs.com/package/discord-emoji */ $emojis = json_decode(file_get_contents($url)); if ($emojis) { foreach ($emojis as $name=>$code) { if (preg_match("/^\d+/", $name)) { $name = "_" . $name; } $name = str_replace("-", "minus", $name); $name = str_replace("+", "plus", $name); $name = str_replace("ñ", "n", $name); if ($name == "new") { $name = "_new"; } $header .= " inline constexpr const char " .$name . "[] = \"$code\";\n"; } $header .= "}\n};\n"; file_put_contents("include/dpp/unicode_emoji.h", $header); }