{"id":13409650,"url":"https://github.com/cee-studio/orca","last_synced_at":"2025-04-08T13:07:33.742Z","repository":{"id":45123773,"uuid":"281536670","full_name":"cee-studio/orca","owner":"cee-studio","description":"C Multi-REST API library for Discord, Slack, Reddit, etc.","archived":false,"fork":false,"pushed_at":"2025-03-03T01:27:06.000Z","size":41964,"stargazers_count":356,"open_issues_count":6,"forks_count":29,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-01T11:06:19.248Z","etag":null,"topics":["bot","c","curl","discord","discord-api","discord-bot","github","reddit","slack","websockets"],"latest_commit_sha":null,"homepage":"https://cee-studio.github.io/orca/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cee-studio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-22T00:46:10.000Z","updated_at":"2025-03-18T19:52:19.000Z","dependencies_parsed_at":"2023-02-01T01:30:53.614Z","dependency_job_id":"6a05f4ed-ec4c-461f-bb08-09c74795b990","html_url":"https://github.com/cee-studio/orca","commit_stats":{"total_commits":2250,"total_committers":16,"mean_commits":140.625,"dds":0.3973333333333333,"last_synced_commit":"10f8098b754e5bcf226943230ec2ff69fdf38719"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cee-studio%2Forca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cee-studio%2Forca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cee-studio%2Forca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cee-studio%2Forca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cee-studio","download_url":"https://codeload.github.com/cee-studio/orca/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247847610,"owners_count":21006100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","c","curl","discord","discord-api","discord-bot","github","reddit","slack","websockets"],"created_at":"2024-07-30T20:01:02.554Z","updated_at":"2025-04-08T13:07:33.708Z","avatar_url":"https://github.com/cee-studio.png","language":"C","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cbr /\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://cee-studio.github.io/orca\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/cee-studio/orca-docs/master/docs/source/images/logo.svg\" width=\"546\" alt=\"orca\" style=\"background-color:red;\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cbr /\u003e\n  \u003cp\u003e\n    Easy to reason, easy to debug, easy to use.\n  \u003c/p\u003e\n  \u003cp\u003e\n    Join our Discord server: \u003cbr\u003e \u003ca href=\"https://discord.gg/nBUqrWf\"\u003e\u003cimg src=\"https://img.shields.io/discord/562694099887587338?color=5865F2\u0026logo=discord\u0026logoColor=white\" alt=\"Discord server\" /\u003e\u003c/a\u003e \u003c/br\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n## About\n\nOrca is implemented in plain C, its symbols are organized to be easily matched to the documentation of the API being covered.\n\nThis is done in order to:\n* Minimize the need to thoroughly document every Orca API.\n* Reduce our user's cognitive burden of having to read both Orca API documentation and supported REST API documentation.\n* The codebase becomes easier to navigate.\n\nOrca's implementation has minimum external dependencies to make bot deployment deadly simple.\n\n### Design\n\n- Easy to reason about the code: the most native data structures,\n   the simplest algorithms, and intuitive interfaces.\n\n- Easy to debug (networking and logic) errors: extensive assertion \n  and logging facilities.\n\n- Easy to use for the end users: highly scalable, all transfers made with\n  Orca are thread-safe.\n\n### Minimal example\n\n```c\n#include \u003cstring.h\u003e // strcmp()\n#include \u003corca/discord.h\u003e\n\nvoid on_ready(struct discord *client) \n{\n  const struct discord_user *bot = discord_get_self(client);\n  log_info(\"Logged in as %s!\", bot-\u003eusername);\n}\n\nvoid on_message(struct discord *client, const struct discord_message *msg)\n{\n  if (strcmp(msg-\u003econtent, \"ping\") != 0)\n    return; // ignore messages that aren't 'ping'\n\n  discord_async_next(client, NULL); // make next request non-blocking (OPTIONAL)\n  struct discord_create_message_params params = { .content = \"pong\" };\n  discord_create_message(client, msg-\u003echannel_id, \u0026params, NULL);\n}\n\nint main(void)\n{\n  struct discord *client = discord_init(BOT_TOKEN);\n  discord_set_on_ready(client, \u0026on_ready);\n  discord_set_on_message_create(client, \u0026on_message);\n  discord_run(client);\n}\n```\n*This is a minimalistic example, refer to [`examples/`](examples/) for a better overview.*\n\n## Build Instructions\n\n### On Windows\n\n* Install **WSL2** and get either Ubuntu or Debian [here](https://docs.microsoft.com/en-us/windows/wsl/install-win10).\n* **Make sure you are in your Linux $HOME folder before proceeding!**\n* Continue to [On Linux](#on-linux) and follow your distro's building steps.\n\n### On Linux\n\nThe only dependency is `curl-7.4.1` or higher\n\n#### Ubuntu and Debian\n\n```bash\n$ sudo apt install -y build-essential libcurl4-openssl-dev\n```\n\n#### Void Linux\n\n```bash\n$ sudo xbps-install -S libcurl-devel\n```\n### Setting up your environment\n\n#### Clone orca into your workspace\n\n```bash\n$ git clone https://github.com/cee-studio/orca.git \u0026\u0026 cd orca\n```\n\n#### Compile orca\n\n```bash\n$ make\n```\n\n### Configuring orca\n\nThe following outlines the default fields of `config.json`\n```js\n{\n  \"logging\": { // logging directives\n    \"level\": \"trace\",        // trace, debug, info, warn, error, fatal\n    \"filename\": \"bot.log\",   // the output file\n    \"quiet\": false,          // change to true to disable logs in console\n    \"overwrite\": false,      // overwrite existing file with \"filename\"\n    \"use_color\": true,       // log with color\n    \"http\": {\n      \"enable\": true,        // generate http specific logging\n      \"filename\": \"http.log\" // the output file\n    },\n    \"disable_modules\": [\"WEBSOCKETS\", \"USER_AGENT\"] // disable logging for these modules\n  },\n  ...         // API directives (discord, slack, github, etc)\n}\n```\n\n### Test Echo-Bot\n\n1. Get your bot token and add it to `config.json`, \n   by assigning it to discord's \"token\" field. There are \n   well written instructions from the \n   [discord-irc](https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-\u0026-getting-a-token)\n   about how to get your bot token and adding it to a server.\n2. Build example executables:\n   ```bash\n   $ make examples\n   ```\n3. Run Echo-Bot:\n   ```bash\n   $ cd examples \u0026\u0026 ./bot-echo\n   ```\n\n#### Get Echo-Bot Response\n\nType a message in any channel the bot is part of and the bot should send an echo response in return.\n\n#### Terminate Echo-Bot\n\nWith \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003ec\u003c/kbd\u003e or by closing the Terminal.\n\n### Create your first bot\n\n* Head to `my_bot/`, a special folder set-up for your convenience that may be modified freely.\n* Read our guide for [building your first bot](docs/BUILDING_A_BOT.md).\n\n## Installing orca\n\nOrca can be installed in case developing inside of `my_bot/` doesn't suit your needs:\n```bash\n$ sudo make install\n```\n\nIncluded headers must be `orca/` prefixed:\n```c\n#include \u003corca/discord.h\u003e\n```\n\n### Standalone executable\n\n#### GCC (Recommended)\n\n```bash\n$ gcc myBot.c -o myBot -pthread -ldiscord -lcurl\n```\n\n#### Clang\n\n```bash\n$ clang myBot.c -o myBot -pthread -ldiscord -lcurl\n```\n\n## Recommended debuggers\n\nFirst, make sure your executable is compiled with the `-g` flag to ensure human-readable debugger messages.\n\n### Valgrind\n\nUsing valgrind to check for memory leaks:\n\n```bash\n$ valgrind --leak-check=full ./myBot\n```\nFor a more comprehensive guide check [Valgrind's Quick Start](https://valgrind.org/docs/manual/quick-start.html).\n\n### GDB\n\nUsing GDB to check for runtime errors, such as segmentation faults:\n\n```bash\n$ gdb ./myBot\n```\nAnd then execute your bot from the gdb environment:\n```bash\n(gdb) run\n```\nIf the program has crashed, get a backtrace of the function calls leading to it:\n```bash\n(gdb) bt\n```\n\nFor a more comprehensive guide check [Beej's Quick Guide to GDB](https://beej.us/guide/bggdb/)\n\n## Support\n\nProblems? Check out our [Discord Server](https://discord.gg/nBUqrWf).\n\n## Links\n\n- [Documentation](https://cee-studio.github.io/orca/)\n- [Building your first bot](docs/BUILDING_A_BOT.md)\n- [Contributing](docs/CONTRIBUTING.md)\n\u003c!-- - [Internals](docs/INTERNALS.md) --\u003e\n\n## Contributing\nCheck our [Contributing Guidelines](docs/CONTRIBUTING.md) to get started! If you are here for the Discord API, please check our [Discord API Roadmap](docs/DISCORD_ROADMAP.md).\n\n**Give us a star if you like this project!**\n","funding_links":[],"categories":["API Libraries","Libraries"],"sub_categories":["C"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcee-studio%2Forca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcee-studio%2Forca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcee-studio%2Forca/lists"}