diff --git a/bot.go b/bot.go index f41522e..e8c9bef 100644 --- a/bot.go +++ b/bot.go @@ -6,20 +6,19 @@ import ( "fmt" "io" "net/http" - "scurotgbot/utils" "strings" ) type Bot struct { token string - logger *utils.Logger + logger *Logger debug bool plugins []*Plugin prefixes []string updateOffset int - updateQueue *utils.Queue[*Update] + updateQueue *Queue[*Update] } type MsgContext struct { @@ -31,9 +30,9 @@ type MsgContext struct { } func NewBot(token string) *Bot { - logger := utils.Create() - logger.SetLevel(utils.DEBUG) - updateQueue := utils.CreateQueue[*Update](256) + logger := CreateLogger() + logger.SetLevel(DEBUG) + updateQueue := CreateQueue[*Update](256) bot := &Bot{ updateOffset: 0, plugins: make([]*Plugin, 0), debug: false, prefixes: make([]string, 0), @@ -124,7 +123,7 @@ func (b *Bot) SetDebug(debug bool) { b.debug = debug } -func (b *Bot) GetQueue() *utils.Queue[*Update] { +func (b *Bot) GetQueue() *Queue[*Update] { return b.updateQueue } diff --git a/logger.go b/logger.go index 3060ed5..26ee277 100644 --- a/logger.go +++ b/logger.go @@ -51,7 +51,7 @@ var methodLevelMap = map[string]LogLevel{ "get": GET, "post": POST, "put": PUT, "delete": DELETE, } -func Create() *Logger { +func CreateLogger() *Logger { return &Logger{ prefix: "LOG", level: FATAL,