base logon
This commit is contained in:
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Linux",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**",
|
||||
"${workspaceFolder}/include"
|
||||
],
|
||||
"defines": [],
|
||||
"compilerPath": "/usr/bin/clang",
|
||||
"cStandard": "c17",
|
||||
"intelliSenseMode": "linux-clang-x64"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
@@ -316,6 +316,7 @@ else()
|
||||
-fsanitize=bounds-strict
|
||||
-fno-sanitize-recover=undefined
|
||||
-fno-omit-frame-pointer
|
||||
-fno-sanitize=function
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
+18
-2
@@ -1,6 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <concord/discord.h>
|
||||
#include <concord/log.h>
|
||||
|
||||
void on_ready(struct discord* client, const struct discord_ready* event) {
|
||||
log_info("Logged in as %s", event->user->username);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
printf("Hello, World!\n");
|
||||
ccord_global_init();
|
||||
|
||||
struct discord* client = discord_config_init("config.json");
|
||||
|
||||
discord_set_on_ready(client, &on_ready);
|
||||
|
||||
discord_run(client);
|
||||
|
||||
discord_cleanup(client);
|
||||
ccord_global_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user