Skip to content

Commit

Permalink
docs: documentation for unicode_emoji namespace (#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil authored Jul 20, 2023
1 parent a29192a commit bca1666
Showing 1 changed file with 20 additions and 2 deletions.
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

0 comments on commit bca1666

Please sign in to comment.