File tree 2 files changed +10
-7
lines changed
2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " tglib" ,
3
- "version" : " 3.0.4 " ,
3
+ "version" : " 3.0.5 " ,
4
4
"author" : " nodegin" ,
5
5
"license" : " MIT" ,
6
6
"description" : " TDLib (Telegram Database library) bindings for Node.js" ,
Original file line number Diff line number Diff line change @@ -133,18 +133,21 @@ class Client {
133
133
}
134
134
case 'authorizationStateWaitCode' : {
135
135
const payload = { '@type' : 'checkAuthenticationCode' }
136
- if ( ! update [ 'authorization_state' ] [ 'is_registered' ] ) {
137
- console . log ( `User ${ value } has not yet been registered with Telegram` )
138
- payload [ 'first_name' ] = await this . callbacks [ 'td:getInput' ] ( {
139
- string : 'tglib.input.FirstName' ,
140
- } )
141
- }
142
136
payload [ 'code' ] = await this . callbacks [ 'td:getInput' ] ( {
143
137
string : 'tglib.input.AuthorizationCode' ,
144
138
} )
145
139
this . _send ( payload )
146
140
break
147
141
}
142
+ case 'authorizationStateWaitRegistration' : {
143
+ const payload = { '@type' : 'registerUser' } ;
144
+ console . log ( `User has not yet been registered with Telegram` ) ;
145
+ payload [ 'first_name' ] = await this . callbacks [ 'td:getInput' ] ( {
146
+ string : 'tglib.input.FirstName' ,
147
+ } ) ;
148
+ this . _send ( payload ) ;
149
+ break
150
+ }
148
151
case 'authorizationStateWaitPassword' : {
149
152
this . authFlowPasswordHint = update [ 'authorization_state' ] [ 'password_hint' ]
150
153
const password = await this . callbacks [ 'td:getInput' ] ( {
You can’t perform that action at this time.
0 commit comments