Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Commit

Permalink
Add logging to few parts
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyaglow committed Nov 28, 2018
1 parent d409baa commit db411f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions run.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func (c *Client) Run() {
if update.Message.IsCommand() &&
update.Message.Command() == "start" &&
!c.CheckAuth(update.Message.From) {
c.log("run: new unauthorized user")
msg.Text = "Enter your password"
if _, err := c.Bot.Send(msg); err != nil {
log.Println(err)
Expand All @@ -53,12 +54,14 @@ func (c *Client) Run() {
}

if c.CheckAuth(update.Message.From) {
c.log("run: auth succeeded")
go func() {
if err := c.processMessage(update.Message); err != nil {
log.Println(err)
}
}()
} else {
c.log("run: wrong password from the user")
if err := c.Auth(update.Message); err != nil {
log.Println(err)
}
Expand Down

0 comments on commit db411f6

Please sign in to comment.