feat&fix: fix build and add initial authnetication
This commit is contained in:
+16
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user