Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
O

orca

> 开发工具
Open source

C Multi-REST API library for Discord, Slack, Reddit, etc.

145.5K stars0 likes10 views
WebsiteGitHub

About

C Multi-REST API library for Discord, Slack, Reddit, etc.

About

Orca is implemented in plain C, its symbols are organized to be easily matched to the documentation of the API being covered.

This is done in order to:

  • Minimize the need to thoroughly document every Orca API.
  • Reduce our user's cognitive burden of having to read both Orca API documentation and supported REST API documentation.
  • The codebase becomes easier to navigate.

Orca's implementation has minimum external dependencies to make bot deployment deadly simple.

Design

  • Easy to reason about the code: the most native data structures, the simplest algorithms, and intuitive interfaces.

  • Easy to debug (networking and logic) errors: extensive assertion and logging facilities.

  • Easy to use for the end users: highly scalable, all transfers made with Orca are thread-safe.

Minimal example

…

This is a minimalistic example, refer to examples/ for a better overview.

Build Instructions

On Windows

  • Install WSL2 and get either Ubuntu or Debian here.
  • Make sure you are in your Linux $HOME folder before proceeding!
  • Continue to On Linux and follow your distro's building steps.

On Linux

The only dependency is curl-7.4.1 or higher

Ubuntu and Debian

bash
$ sudo apt install -y build-essential libcurl4-openssl-dev

Void Linux

bash
$ sudo xbps-install -S libcurl-devel

Setting up your environment

Clone orca into your workspace

bash
$ git clone https://github.com/cee-studio/orca.git && cd orca

Compile orca

bash
$ make

Configuring orca

The following outlines the default fields of config.json

…

Test Echo-Bot

  1. Get your bot token and add it to config.json, by assigning it to discord's "token" field. There are well written instructions from the discord-irc about how to get your bot token and adding it to a server.
  2. Build example executables:
    bash
    $ make examples
  3. Run Echo-Bot:
    bash
    $ cd examples && ./bot-echo

Get Echo-Bot Response

Type a message in any channel the bot is part of and the bot should send an echo response in return.

Terminate Echo-Bot

With Ctrl+c or by closing the Terminal.

Create your first bot

  • Head to my_bot/, a special folder set-up for your convenience that may be modified freely.
  • Read our guide for building your first bot.

Installing orca

Orca can be installed in case developing inside of my_bot/ doesn't suit your needs:

bash
$ sudo make install

Included headers must be orca/ prefixed:

c
#include <orca/discord.h>

Standalone executable

GCC (Recommended)

bash
$ gcc myBot.c -o myBot -pthread -ldiscord -lcurl

Clang

bash
$ clang myBot.c -o myBot -pthread -ldiscord -lcurl

Recommended debuggers

First, make sure your executable is compiled with the -g flag to ensure human-readable debugger messages.

Valgrind

Using valgrind to check for memory leaks:

bash
$ valgrind --leak-check=full ./myBot

For a more comprehensive guide check Valgrind's Quick Start.

GDB

Using GDB to check for runtime errors, such as segmentation faults:

bash
$ gdb ./myBot

And then execute your bot from the gdb environment:

bash
(gdb) run

If the program has crashed, get a backtrace of the function calls leading to it:

bash
(gdb) bt

For a more comprehensive guide check Beej's Quick Guide to GDB

Support

Problems? Check out our Discord Server.

Links

  • Documentation
  • Building your first bot
  • Contributing

Contributing

Check our Contributing Guidelines to get started! If you are here for the Discord API, please check our Discord API Roadmap.

Give us a star if you like this project!

Issues· 6 open

View all issuesOpen on GitHub
  • #769

    NULL Pointer in ntl_to_buf()

    Updated Sep 12, 2025
  • #767

    Request New Forum Channel Support

    Updated Sep 20, 2022
  • #765

    Timeout API support

    Updated Feb 12, 2022
  • #761

    loginfo does not work even with logconf as false

    Updated Jan 2, 2022
  • #749

    Incomplete Emoji Creation Function

    missing_featureUpdated Dec 1, 2021
  • #702

    Wrap the remaining Discord Endpoints

    need_helpmissing_featureUpdated Nov 2, 2021

> Tags

Cbotccurldiscord

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedNov 30, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具