diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-06-16 07:44:48 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-06-16 07:44:48 +0300 |
commit | 739fc4110a9c12aa51cbd6361e5c4398c8ed7ff8 (patch) | |
tree | bc0de1eafa37959b193367f5368763244f7377ac | |
parent | fdd867cf7a435346a552a8da7f446b59b5e1213e (diff) |
Fix a crash by auth commands when online
-rw-r--r-- | telegram/commands.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/telegram/commands.go b/telegram/commands.go index cafeb0a..2f879b1 100644 --- a/telegram/commands.go +++ b/telegram/commands.go @@ -259,6 +259,10 @@ func (c *Client) ProcessTransportCommand(cmdline string, resource string) string return telegramNotInitialized } + if c.authorizer.isClosed { + return "Authorization is done already" + } + switch cmd { // sign in case "login": @@ -290,7 +294,7 @@ func (c *Client) ProcessTransportCommand(cmdline string, resource string) string // cancel auth case "cancelauth": if c.Online() { - return "Not allowed when online" + return "Not allowed when online, use /logout instead" } c.cancelAuth() return "Cancelled" |