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

added docker support

This commit is contained in:
2018-05-30 21:23:03 -05:00
parent af8448e028
commit 3d05a49a3e
20 changed files with 125 additions and 196 deletions

35
server/main.go Normal file
View File

@@ -0,0 +1,35 @@
package main
import (
"os"
"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"
log "github.com/sirupsen/logrus"
)
func init() {
log.SetLevel(log.DebugLevel)
log.SetFormatter(&log.JSONFormatter{})
log.SetOutput(os.Stdout)
//read config file
config.Init()
if config.Config.Logger {
db.Init()
db.Conn.AutoMigrate(&logger.Message{}, &logger.Attachment{}, &logger.User{})
}
}
func main() {
// start the bot
bot.Start(config.Config.Token)
// start the web server
webserver.Start()
}