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