1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-11 09:32:50 +00:00

play sounds from web ui - store uploaded sounds in database

This commit is contained in:
2018-09-12 23:36:44 -05:00
parent 325203cc5e
commit be359f7424
26 changed files with 390 additions and 245 deletions

View File

@@ -6,7 +6,6 @@ import (
"github.com/mgerb/go-discord-bot/server/bot"
"github.com/mgerb/go-discord-bot/server/config"
"github.com/mgerb/go-discord-bot/server/db"
"github.com/mgerb/go-discord-bot/server/logger"
"github.com/mgerb/go-discord-bot/server/webserver"
"github.com/mgerb/go-discord-bot/server/webserver/model"
log "github.com/sirupsen/logrus"
@@ -14,21 +13,18 @@ import (
func init() {
log.SetLevel(log.DebugLevel)
log.SetFormatter(&log.JSONFormatter{})
log.SetOutput(os.Stdout)
file, err := os.OpenFile("logrus.log", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0666)
if err == nil {
log.SetOutput(file)
} else {
log.Info("Failed to log to file, using default stderr")
}
//read config file
config.Init()
if config.Config.Logger {
migrations := []interface{}{
&logger.Message{},
&logger.Attachment{},
&logger.User{},
&model.VideoArchive{},
}
db.Init(migrations...)
}
db.Init(model.Migrations...)
}
func main() {