dscrd
Discord C library
Fast start

General library usage

Normal (authenticated) library usage:

  1. Initialize library with dscrd_initialize();
    1. Authenticate with DiscordClient_open (type, token), where type is one of token_type_e and token is your token string. You will get DiscordClient pointer in return. You will need it for dscrd library calls.
      1. Call library functions and receive other objects like Webhook.
      2. Free all objects you receive, for example use Webhook_destroy (Webhook) to free Webhooks.
    2. Close Discord session with DiscordClient_close (DiscordClient).
  2. Close library with dscrd_terminate();

Webhook-only (no-authentication) library usage:

  1. Initialize library with dscrd_initialize();
    1. Load your webhooks with no-auth functions like Webhook_get_no_auth() or Webhook_get_no_auth_url().
      1. Call webhook functions like Webhook_execute/modify/delete and so on.
    2. Free all allocated webhooks.
  2. Close library with dscrd_terminate();

Gateway API

Gateway API in dscrd library is optional. It can even be excluded from build. You can check if Gateway API was disabled by calling dscrd_has_gateway(). To use Gateway API with your DiscordClient you will need to initiate it with DiscordClient_gateway(). Function will return 0 on connection success. After you done it you can use all functions which use gateway. When you're finished no more action is needed except the usual DiscordClient_close().

Misc