diff options
author | Trumeet <yuuta@yuuta.moe> | 2021-10-17 18:26:24 -0700 |
---|---|---|
committer | Trumeet <yuuta@yuuta.moe> | 2021-10-17 18:26:24 -0700 |
commit | f5538d7a74b3dcb9cd392d76554ae0ff2aac5d4e (patch) | |
tree | 6a66a897008495d83ba5babf5ff7cba1b3779cae | |
parent | 0b3b5a48c42047731b3388f14a2aeb92f19d572c (diff) | |
download | easy-tg-f5538d7a74b3dcb9cd392d76554ae0ff2aac5d4e.tar easy-tg-f5538d7a74b3dcb9cd392d76554ae0ff2aac5d4e.tar.gz easy-tg-f5538d7a74b3dcb9cd392d76554ae0ff2aac5d4e.tar.bz2 easy-tg-f5538d7a74b3dcb9cd392d76554ae0ff2aac5d4e.zip |
-rw-r--r-- | easy-tg.c | 12 | ||||
-rw-r--r-- | easy-tg.h | 5 |
2 files changed, 17 insertions, 0 deletions
@@ -82,6 +82,18 @@ cleanup: return r; } +int tg_login_token( + const char *token + ) +{ + int r = 0; + json_object *raw_req = json_object_new_string(token); + tg_send(false, tg_mkreq(TG_REQ_LOGIN_TOKEN, "checkAuthenticationBotToken", "token", raw_req), true); + goto cleanup; +cleanup: + return r; +} + int tg_login_code( const char *code ) @@ -39,6 +39,7 @@ #define TG_REQ_SET_PARAMS "set_params" #define TG_REQ_LOGIN_PHONE "login_phone" +#define TG_REQ_LOGIN_TOKEN "login_token" #define TG_REQ_LOGIN_CODE "login_code" #define TG_REQ_LOGIN_PASS "login_pass" @@ -96,6 +97,10 @@ int tg_login_phone( const char *phone_number ); /* MT-Safe */ +int tg_login_token( + const char *token + ); +/* MT-Safe */ int tg_login_code( const char *code ); |