package db import ( "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/sqlite" ) var db *gorm.DB func init() { var err error db, err = gorm.Open("sqlite3", "bot.db") if err != nil { panic(err) } db.AutoMigrate(&ReactRole{}) db.AutoMigrate(&PlayerLevel{}) } func Close() { db.Close() }