feat&fix: fix build and add initial authnetication

This commit is contained in:
2026-05-29 13:39:57 +02:00
parent 89787b36cc
commit c29b4bb008
12 changed files with 190 additions and 11 deletions
+16 -1
View File
@@ -1,9 +1,24 @@
#ifndef DISCORD_DISCORD_H
#define DISCORD_DISCORD_H
#include "error.h"
// @TODO: use opaque pointer
#include <curl/curl.h>
#define DISCORD_BASE_URL "https://discord.com/api"
#define DISCORD_API_VERSION "10"
#define DISCORD_MAX_API_URL 256
#define DISCORD_MAX_TOKEN_VALUE 128
typedef struct discord_client discord_client;
typedef struct discord_client {
// char *token_type; // Bot or Bearer
char token_value[DISCORD_MAX_TOKEN_VALUE];
char api_url[DISCORD_MAX_API_URL];
CURL *curl;
} discord_client;
// remember to call curl_global_cleanup()
discord_error discord_init(discord_client *client, const char *token);
#endif