diff --git a/config.template.json b/config.template.json index 6fb1f1c..9bb267e 100644 --- a/config.template.json +++ b/config.template.json @@ -1,6 +1,6 @@ { "Token": "your_bot_token_id", - "AlertRoomID": "your_room_id", + "RoomIDList": ["id_1", "id_2", "id_3"], "Servers": [ { "Name": "Elysium PvP", diff --git a/dist/ServerStatus-linux b/dist/ServerStatus-linux index a68cad5..89d26a3 100755 Binary files a/dist/ServerStatus-linux and b/dist/ServerStatus-linux differ diff --git a/dist/ServerStatus-windows.exe b/dist/ServerStatus-windows.exe index 21b2c3d..d927aa7 100755 Binary files a/dist/ServerStatus-windows.exe and b/dist/ServerStatus-windows.exe differ diff --git a/dist/config.json b/dist/config.json index 6fb1f1c..9bb267e 100644 --- a/dist/config.json +++ b/dist/config.json @@ -1,6 +1,6 @@ { "Token": "your_bot_token_id", - "AlertRoomID": "your_room_id", + "RoomIDList": ["id_1", "id_2", "id_3"], "Servers": [ { "Name": "Elysium PvP", diff --git a/src/config/config.go b/src/config/config.go index b40c4cb..f70df70 100644 --- a/src/config/config.go +++ b/src/config/config.go @@ -11,9 +11,9 @@ import ( var Config configStruct type configStruct struct { - Token string `json:"Token"` - AlertRoomID string `json:"AlertRoomID"` - Servers []server `json:"Servers"` + Token string `json:"Token"` + RoomIDList []string `json:"RoomIDList"` + Servers []server `json:"Servers"` } type server struct { diff --git a/src/serverstatus/serverstatus.go b/src/serverstatus/serverstatus.go index 8083652..bf1264d 100644 --- a/src/serverstatus/serverstatus.go +++ b/src/serverstatus/serverstatus.go @@ -49,7 +49,9 @@ func loop() { } func sendMessage(message string) { - bot.Session.ChannelMessageSend(config.Config.AlertRoomID, message) + for _, roomID := range config.Config.RoomIDList { + bot.Session.ChannelMessageSend(roomID, message) + } } // This function will be called every time a new @@ -66,7 +68,7 @@ func MessageHandler(s *discordgo.Session, m *discordgo.MessageCreate) { if server.Online { s.ChannelMessageSend(m.ChannelID, server.Name+" is online!") } else { - s.ChannelMessageSend(m.ChannelID, server.Name+"is down!") + s.ChannelMessageSend(m.ChannelID, server.Name+" is down!") } } }