Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: documentation for unicode_emoji namespace #739

Merged
merged 10 commits into from
Jul 20, 2023
22 changes: 20 additions & 2 deletions buildtools/emojis.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,28 @@

echo "-- Autogenrating include/dpp/unicode_emoji.h\n";

$header = "#pragma once\n\nnamespace dpp { namespace unicode_emoji {\n";
$url = "https://raw.githubusercontent.com/ArkinSolomon/discord-emoji-converter/master/emojis.json";

$header = <<<END
#pragma once

namespace dpp {

/**
* The unicode emojis in this namespace are auto-generated from {$url}
*
* If you want to use this, you have to pull the header in separately. e.g.
* ```cpp
* #include <dpp/dpp.h>
* #include <dpp/unicode_emoji.h>
* ```
*/
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("https://raw.githubusercontent.com/ArkinSolomon/discord-emoji-converter/master/emojis.json"));
$emojis = json_decode(file_get_contents($url));
if ($emojis) {
foreach ($emojis as $name=>$code) {
if (preg_match("/^\d+/", $name)) {
Expand Down