many changes; using dev laniakea
This commit is contained in:
10
main.go
10
main.go
@@ -1,6 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"git.nix13.pw/scuroneko/laniakea"
|
||||
|
||||
"ymgb/database"
|
||||
@@ -10,6 +12,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
log.Println(laniakea.EscapeMarkdownV2("Загрузка..."))
|
||||
_ = godotenv.Load(".env", ".env.production", ".env.ai")
|
||||
|
||||
database.ConnectPostgres()
|
||||
@@ -17,7 +20,12 @@ func main() {
|
||||
database.ConnectRedis()
|
||||
|
||||
bot := laniakea.NewBot[database.Context](laniakea.LoadOptsFromEnv())
|
||||
defer bot.Close()
|
||||
defer func(bot *laniakea.Bot[database.Context]) {
|
||||
err := bot.Close()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}(bot)
|
||||
bot = bot.ErrorTemplate("Во время выполнения команды произошла ошибка!\nСообщите об этом разработчику!\n\n%s")
|
||||
bot = bot.DatabaseContext(&database.Context{
|
||||
Postgres: database.PostgresDatabase,
|
||||
|
||||
Reference in New Issue
Block a user