Skip to content

Commit

Permalink
fix .SetToken
Browse files Browse the repository at this point in the history
  • Loading branch information
codenoid committed Sep 8, 2021
1 parent 6449c69 commit dca2fa9
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions telelog.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,15 @@ func LoggerNew(token ...string) *Logger {
func (i *Logger) SetToken(token string) error {
token = strings.TrimSpace(token)

if token != i.token {
i.token = token
i.token = token

bot, err := tgbotapi.NewBotAPI(i.token)
if err != nil {
return err
}

i.bot = bot
bot, err := tgbotapi.NewBotAPI(i.token)
if err != nil {
return err
}

i.bot = bot

return nil
}

Expand Down

0 comments on commit dca2fa9

Please sign in to comment.