diff --git a/include/hammy/command.h b/include/hammy/command.h index d134524..46d7d20 100644 --- a/include/hammy/command.h +++ b/include/hammy/command.h @@ -2,6 +2,7 @@ #define HAMMY_COMMAND_H #include +#include #include #include diff --git a/src/hammy/bot.c b/src/hammy/bot.c index 32ca995..c18bef2 100644 --- a/src/hammy/bot.c +++ b/src/hammy/bot.c @@ -17,12 +17,6 @@ hammy_bot_t* hammy_bot_create() { return NULL; } - if (vector_set_destructor(bot->commands, &hammy_command_destroy) < 0) { - vector_destroy(&bot->commands); - free(bot); - return NULL; - } - // Init the discord client - even though this is an owning reference, the main() and others may call functions on it (if we don't stay singlethread anymore then FIX THIS) bot->client = discord_from_json("config.json"); if (!bot->client) { diff --git a/src/hammy/command.c b/src/hammy/command.c index 7a78ad4..a1bcb6c 100644 --- a/src/hammy/command.c +++ b/src/hammy/command.c @@ -6,7 +6,11 @@ // Handlers live in src/hammy/commands/. Declared here rather than in a header // so adding a command touches exactly two places: its own .c file and this // table. -void hammy_cmd_ping(const hammy_job_t* job, struct discord* client); +void hammy_cmd_ping(const hammy_job_t* job, struct discord* client) { + (void)job; + (void)client; + log_info("[command] ping"); +} // The command table. Pure data - no allocation, no lifetime, no destructor. // Copying an entry into the bot's vector is a plain struct copy, and the vector