From 4ef9902b48f0505e4905d61afcb6611908830d4a Mon Sep 17 00:00:00 2001 From: Will Brown Date: Sat, 23 Nov 2024 19:12:57 -0500 Subject: [PATCH] [main.c] Move timer creation outside of on_ready() --- main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/main.c b/main.c index a1e246f..fb0ea0a 100644 --- a/main.c +++ b/main.c @@ -346,9 +346,6 @@ static void on_ready(struct discord *client, const struct discord_ready *event) for (struct bot_command *i = commands; i < commands + sizeof(commands) / sizeof(*commands); ++i) { discord_create_global_application_command(client, event->application->id, &i->cmd, NULL); } - - // create feed retrieval timers - discord_timer_interval(client, timer_retrieve_feeds, NULL, NULL, 0, TIMER_INTERVAL, -1); log_info("Ready!"); } @@ -392,6 +389,7 @@ int main(void) { discord_set_on_ready(client, &on_ready); discord_set_on_interaction_create(client, &on_interaction); + discord_timer_interval(client, timer_retrieve_feeds, NULL, NULL, 0, TIMER_INTERVAL, -1); discord_run(client); PQfinish(database_conn);