diff --git a/.vscode/tasks.json b/.vscode/tasks.json index b9f2c801..1100eadf 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,45 +1,27 @@ { - "version": "2.0.0", - "tasks": [{ - "label": "build-debug", - "type": "shell", - "command": "go", - "group": "build", - "presentation": { - "echo": true, - "reveal": "never", - "focus": false, - "panel": "shared" - }, - "args": [ - "build", - "-i", - "-gcflags", - "'-N -l'" - ], - "linux": { - "args": [ - "-o", - "debug", - "${workspaceRoot}/cmd/flottbot/main.go" - ] - }, - "osx": { - "args": [ - "-o", - "debug", - "${workspaceRoot}/cmd/flottbot/main.go" - ] - }, - "windows": { - "args": [ - "-o", - "debug.exe", - "\"${workspaceRoot}\\cmd\\flottbot\\main.go\"" - ] - }, - "problemMatcher": [ - "$go" - ] - }] -} \ No newline at end of file + "version": "2.0.0", + "tasks": [ + { + "label": "build-debug", + "type": "shell", + "command": "go", + "group": "build", + "presentation": { + "echo": true, + "reveal": "never", + "focus": false, + "panel": "shared" + }, + "args": [ + "build", + "-i", + "-gcflags", + "'-N -l'", + "-o", + "debug", + "${workspaceFolder}/cmd/flottbot/main.go" + ], + "problemMatcher": ["$go"] + } + ] +} diff --git a/remote/discord/helper.go b/remote/discord/helper.go index 459ba616..770857d2 100644 --- a/remote/discord/helper.go +++ b/remote/discord/helper.go @@ -30,6 +30,9 @@ func populateMessage(message models.Message, msgType models.MessageType, channel // message.ChannelName = name // } + message.Vars["_channel.id"] = channel + message.Vars["_channel.name"] = channel + // Populate message user sender // These will be accessible on rules via ${_user.email}, etc if user != nil { // nil user implies a message from an api/bot (i.e. not an actual user) diff --git a/remote/slack/helper.go b/remote/slack/helper.go index 48c8ff5a..86712605 100644 --- a/remote/slack/helper.go +++ b/remote/slack/helper.go @@ -396,6 +396,10 @@ func populateMessage(message models.Message, msgType models.MessageType, channel message.ChannelName = name } + // make channel variables available + message.Vars["_channel.id"] = message.ChannelID + message.Vars["_channel.name"] = message.ChannelName // will be empty if it came via DM + // Populate message with user information (i.e. who sent the message) // These will be accessible on rules via ${_user.email}, ${_user.id}, etc. if user != nil { // nil user implies a message from an api/bot (i.e. not an actual user)