Skip to content

Commit

Permalink
support checkAuthenticationBotToken
Browse files Browse the repository at this point in the history
  • Loading branch information
Trumeet committed Oct 18, 2021
1 parent 0b3b5a4 commit f5538d7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions easy-tg.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ int tg_login_phone(
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
)
Expand Down
5 changes: 5 additions & 0 deletions easy-tg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
);
Expand Down

0 comments on commit f5538d7

Please sign in to comment.