registration fix
This commit is contained in:
parent
d892a9395a
commit
997dc1006a
|
@ -59,7 +59,7 @@ func main() {
|
||||||
|
|
||||||
// client authorizer
|
// client authorizer
|
||||||
authorizer := client.ClientAuthorizer()
|
authorizer := client.ClientAuthorizer()
|
||||||
go client.CliInteractor(authorizer, false)
|
go client.CliInteractor(authorizer)
|
||||||
|
|
||||||
// or bot authorizer
|
// or bot authorizer
|
||||||
botToken := "000000000:gsVCGG5YbikxYHC7bP5vRvmBqJ7Xz6vG6td"
|
botToken := "000000000:gsVCGG5YbikxYHC7bP5vRvmBqJ7Xz6vG6td"
|
||||||
|
|
|
@ -98,7 +98,7 @@ func (stateHandler *clientAuthorizer) Handle(client *Client, state Authorization
|
||||||
return ErrNotSupportedAuthorizationState
|
return ErrNotSupportedAuthorizationState
|
||||||
}
|
}
|
||||||
|
|
||||||
func CliInteractor(clientAuthorizer *clientAuthorizer, registration bool) {
|
func CliInteractor(clientAuthorizer *clientAuthorizer) {
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case state := <-clientAuthorizer.State:
|
case state := <-clientAuthorizer.State:
|
||||||
|
@ -118,7 +118,9 @@ func CliInteractor(clientAuthorizer *clientAuthorizer, registration bool) {
|
||||||
fmt.Println("Enter code: ")
|
fmt.Println("Enter code: ")
|
||||||
fmt.Scanln(&code)
|
fmt.Scanln(&code)
|
||||||
|
|
||||||
if registration {
|
if !state.(*AuthorizationStateWaitCode).IsRegistered {
|
||||||
|
fmt.Println("Phone number is not registered.")
|
||||||
|
|
||||||
fmt.Println("Enter first name: ")
|
fmt.Println("Enter first name: ")
|
||||||
fmt.Scanln(&firstName)
|
fmt.Scanln(&firstName)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue