1
0
mirror of https://github.com/mgerb/ServerStatus synced 2026-03-05 08:55:24 +00:00

add multiple room ID's for notifications

This commit is contained in:
2017-01-17 04:28:46 +01:00
parent d9d7bf58dd
commit 72f06fe031
6 changed files with 9 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
{ {
"Token": "your_bot_token_id", "Token": "your_bot_token_id",
"AlertRoomID": "your_room_id", "RoomIDList": ["id_1", "id_2", "id_3"],
"Servers": [ "Servers": [
{ {
"Name": "Elysium PvP", "Name": "Elysium PvP",

Binary file not shown.

Binary file not shown.

2
dist/config.json vendored
View File

@@ -1,6 +1,6 @@
{ {
"Token": "your_bot_token_id", "Token": "your_bot_token_id",
"AlertRoomID": "your_room_id", "RoomIDList": ["id_1", "id_2", "id_3"],
"Servers": [ "Servers": [
{ {
"Name": "Elysium PvP", "Name": "Elysium PvP",

View File

@@ -12,7 +12,7 @@ var Config configStruct
type configStruct struct { type configStruct struct {
Token string `json:"Token"` Token string `json:"Token"`
AlertRoomID string `json:"AlertRoomID"` RoomIDList []string `json:"RoomIDList"`
Servers []server `json:"Servers"` Servers []server `json:"Servers"`
} }

View File

@@ -49,7 +49,9 @@ func loop() {
} }
func sendMessage(message string) { 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 // This function will be called every time a new