/* Use pthread.h to run background tasks such as reminder
 * aim is to avoid signals (per-process)
*/
#pragma once
#include <pthread.h>
#include "types.h"

typedef struct BotTask {
    pthread_t tid;
    BotReminder *reminder;
} BotTask;

BotReminder *bot_get_last_reminder();
void bot_set_last_reminder(const unsigned int minutes);

BotCommand bot_get_last_command();
void bot_set_last_command(BotCommand cmd);

void bot_task_table_insert(gchar * const key, BotTask * const value);

/* start a thread and update task table */
int bot_start_task (BotReminder *reminder);

/* cancel a thread and remove entry from task table */
void bot_cancel_task(const gchar * const user);
