Merge pull request #533 from c9s/telegram-auth-message

refine auth message
This commit is contained in:
Yo-An Lin 2022-04-16 22:20:45 +08:00 committed by GitHub
commit 8ba0b8c81d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,7 +84,13 @@ func (it *AuthInteract) Commands(interact *Interact) {
}) })
} else { } else {
interact.Command("/auth", "authorize", func(reply Reply) error { interact.Command("/auth", "authorize", func(reply Reply) error {
reply.Message("Enter your authentication code") switch it.Mode {
case AuthModeToken:
reply.Message("Enter your authentication token")
case AuthModeOTP:
reply.Message("Enter your one-time password")
}
return nil return nil
}).NamedNext(StateAuthenticated, func(code string, reply Reply, session Session) error { }).NamedNext(StateAuthenticated, func(code string, reply Reply, session Session) error {
switch it.Mode { switch it.Mode {