-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathankuendigung.coffee
More file actions
37 lines (27 loc) · 896 Bytes
/
Copy pathankuendigung.coffee
File metadata and controls
37 lines (27 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Description:
# Schicke Nachrichten an ausgewaehlte Raeume
#
# Dependencies:
# None
#
# Configuration:
# HUBOT_ANNOUNCE_ROOMS - Liste der Raeume, durch Komma getrennt
#
# Commands:
# hubot Nachricht "<Nachricht>" "<Raum>[,<Raum>]" - Sendet die Nachricht an den / die angegebenen Räume
# hubot Nachricht an alle "<Nachricht>" - Sendet die Nachricht an die vorgegebenen Räume
#
# Author:
# Morgan Delagrange
# Christian Koehler
module.exports = (robot) ->
robot.respond /Nachricht "(.*)" "(.*)"/i, (msg) ->
announcement = msg.match[1]
allRooms = msg.match[2].split(',')
for room in allRooms
robot.messageRoom room, announcement
robot.respond /Nachricht an alle "(.*)"/i, (msg) ->
announcement = msg.match[1]
allRooms = process.env.HUBOT_ANNOUNCE_ROOMS.split(',')
for room in allRooms
robot.messageRoom room, announcement