mirror of
https://github.com/mgerb/ServerStatus
synced 2026-01-08 10:32:48 +00:00
discordgo upgraded from 0.20.0 to 0.24.0 which fixed the bot starting with a websocket error and remaining offline. Additionally, the command prefix and MessageHandling commands have been replaced with Discord's newer slash commands.
36 lines
647 B
Go
36 lines
647 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/mgerb/ServerStatus/bot"
|
|
"github.com/mgerb/ServerStatus/config"
|
|
"github.com/mgerb/ServerStatus/serverstatus"
|
|
)
|
|
|
|
var version = "undefined"
|
|
|
|
func init() {
|
|
fmt.Println("Starting Server Status " + version)
|
|
}
|
|
|
|
func main() {
|
|
//read config file
|
|
config.Configure()
|
|
|
|
//connect bot to account with token
|
|
bot.Connect(config.Config.Token)
|
|
|
|
// add handlers
|
|
bot.AddHandler(serverstatus.InteractionHandler)
|
|
|
|
//start websocket to listen for messages
|
|
bot.Start()
|
|
|
|
//start server status task
|
|
serverstatus.Start()
|
|
|
|
// Simple way to keep program running until CTRL-C is pressed.
|
|
<-make(chan struct{})
|
|
}
|