1
0
mirror of https://github.com/mgerb/ServerStatus synced 2026-01-08 10:32:48 +00:00
Files
ServerStatus/main.go
Ethorbit ed232fc785 Fix outdated broken bot
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.
2024-03-03 11:24:22 -06:00

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{})
}