error log

This commit is contained in:
shoopea 2019-08-30 17:01:25 +08:00
parent a6ab4379b2
commit 3177092fc1

12
main.go
View File

@ -90,25 +90,19 @@ func main() {
var number string var number string
fmt.Scanln(&number) fmt.Scanln(&number)
_, err := client.SendPhoneNumber(number) _, err := client.SendPhoneNumber(number)
if err != nil { logOnError(err, "Error sending phone number.")
fmt.Printf("Error sending phone number: %v", err)
}
} else if currentState.GetAuthorizationStateEnum() == tdlib.AuthorizationStateWaitCodeType { } else if currentState.GetAuthorizationStateEnum() == tdlib.AuthorizationStateWaitCodeType {
fmt.Print("Enter code: ") fmt.Print("Enter code: ")
var code string var code string
fmt.Scanln(&code) fmt.Scanln(&code)
_, err := client.SendAuthCode(code) _, err := client.SendAuthCode(code)
if err != nil { logOnError(err, "Error sending auth code.")
fmt.Printf("Error sending auth code : %v", err)
}
} else if currentState.GetAuthorizationStateEnum() == tdlib.AuthorizationStateWaitPasswordType { } else if currentState.GetAuthorizationStateEnum() == tdlib.AuthorizationStateWaitPasswordType {
fmt.Print("Enter Password: ") fmt.Print("Enter Password: ")
var password string var password string
fmt.Scanln(&password) fmt.Scanln(&password)
_, err := client.SendAuthPassword(password) _, err := client.SendAuthPassword(password)
if err != nil { logOnError(err, "Error sending auth password.")
fmt.Printf("Error sending auth password: %v", err)
}
} else if currentState.GetAuthorizationStateEnum() == tdlib.AuthorizationStateReadyType { } else if currentState.GetAuthorizationStateEnum() == tdlib.AuthorizationStateReadyType {
fmt.Println("Authorization Ready! Let's rock") fmt.Println("Authorization Ready! Let's rock")
break break