v1.0.0 beta 9
This commit is contained in:
5
bot.go
5
bot.go
@@ -74,6 +74,7 @@ type Bot[T DbContext] struct {
|
||||
token string
|
||||
debug bool
|
||||
errorTemplate string
|
||||
username string
|
||||
|
||||
logger *slog.Logger
|
||||
RequestLogger *slog.Logger
|
||||
@@ -140,6 +141,10 @@ func NewBot[T any](opts *BotOpts) *Bot[T] {
|
||||
_ = bot.Close()
|
||||
bot.logger.Fatal(err)
|
||||
}
|
||||
bot.username = Val(u.Username, "")
|
||||
if bot.username == "" {
|
||||
bot.logger.Warn("Can't get bot username. Named command wouldn't work!")
|
||||
}
|
||||
bot.logger.Infof("Authorized as %s\n", u.FirstName)
|
||||
|
||||
return bot
|
||||
|
||||
Reference in New Issue
Block a user