improve api and add checks

This commit is contained in:
2025-05-23 19:39:01 +02:00
parent 2b05e5a8f3
commit 6a552ad363
4 changed files with 77 additions and 62 deletions

View File

@@ -19,7 +19,6 @@ struct tgbot_t {
char token[128]; /**< Bot token. */
char api[512]; /**< Bot API url. */
int32_t offset; /**< Bot offset. */
CURL *curl; /**< Curl object, used to send http requests. */
};
typedef struct tgbot_t tgbot;

View File

@@ -10,7 +10,7 @@ tgbot_rc tgbot_parse_cbquery(tgbot *bot, tgbot_cbquery *query, json_object *resu
/* Request */
size_t write_callback(void *ptr, size_t size, size_t nmemb, char **userdata);
tgbot_rc tgbot_request(tgbot *bot, char *url, struct memory_buffer **mb, json_object *json);
tgbot_rc tgbot_request(const char *url, struct memory_buffer **mb, json_object *json);
/* Methods */
tgbot_rc tgbot_get_me(tgbot *bot, tgbot_me *me);