mirror of
https://github.com/WCBROW01/zblock.git
synced 2025-12-12 04:28:07 -05:00
[main.c] Move timer creation outside of on_ready()
This commit is contained in:
4
main.c
4
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) {
|
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);
|
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!");
|
log_info("Ready!");
|
||||||
}
|
}
|
||||||
@ -392,6 +389,7 @@ int main(void) {
|
|||||||
|
|
||||||
discord_set_on_ready(client, &on_ready);
|
discord_set_on_ready(client, &on_ready);
|
||||||
discord_set_on_interaction_create(client, &on_interaction);
|
discord_set_on_interaction_create(client, &on_interaction);
|
||||||
|
discord_timer_interval(client, timer_retrieve_feeds, NULL, NULL, 0, TIMER_INTERVAL, -1);
|
||||||
discord_run(client);
|
discord_run(client);
|
||||||
|
|
||||||
PQfinish(database_conn);
|
PQfinish(database_conn);
|
||||||
|
|||||||
Reference in New Issue
Block a user