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

major file refactor - fix disconnecting bug

This commit is contained in:
2017-06-30 20:23:05 -05:00
parent 03fa82b2a2
commit de6332e89c
39 changed files with 73 additions and 28 deletions

26
main.go Normal file
View File

@@ -0,0 +1,26 @@
package main
import (
"github.com/mgerb/go-discord-bot/server/bot"
"github.com/mgerb/go-discord-bot/server/bothandlers"
"github.com/mgerb/go-discord-bot/server/config"
"github.com/mgerb/go-discord-bot/server/webserver"
)
func main() {
//read config file
config.Init()
//connect bot to account with token
bot.Connect(config.Config.Token)
//add handlers
bot.AddHandler(bothandlers.SoundsHandler)
bot.AddHandler(bothandlers.GifHandler)
// start new go routine for the discord websockets
go bot.Start()
// start the web server
webserver.Start()
}