Skip to content

Commit

Permalink
add new user variables (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
wass3r authored Feb 14, 2020
1 parent 61c0e8f commit df802eb
Showing 1 changed file with 31 additions and 10 deletions.
41 changes: 31 additions & 10 deletions content/rules/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,39 @@ ${_raw_http_status} response code from an HTTP request action.
${_exec_output} stdout output from an exec action.
${_exec_status} the status code from an exec action.
${_raw_user_input} raw message from a user captured by the bot when a match is found.
${_user.email} email of user that sent a message that triggered a match.
${_user.name} name of user that sent a message that triggered a match.
${_user.firstname} first name of user that sent a message that triggered a match.
${_user.lastname} last name of user that sent a message that triggered a match.
${_user.id} user ID of user that sent a message that triggered a match.
${_channel.id} channel ID where the message originated from.
${_channel.name} channel name where the message originated from[1]
${_channel.name} channel name where the message originated from [^1]
${_is_thread_message} indicates that the rule was triggered from within a message thread, returns "true" or "false"
${_source.link} will provide you with a link to the original message[2]
${_source.link} will provide you with a link to the original message [^2]
```

_1. for Slack, this might be an empty string if it originated from a direct message_
_2. this feature is currently only available for Slack_
- [^1]: for Slack, this might be an empty string if it originated from a direct message
- [^2]: this feature is currently only available for Slack

**Note:** `${_user.firstname}` and `${_user.lastname}` are not populated for Discord, you should instead utilize `${_user.name}`.

In addition, the following user-specific variables - populated with details of the user that triggered a rule match via a message - are available:

```sh
${_user.email}
${_user.name}
${_user.firstname} [^1]
${_user.lastname} [^1]
${_user.id}
${_user.team} [^1]
${_user.teamid} [^1]
${_user.color} [^1]
${_user.realname} [^1]
${_user.tz} [^1]
${_user.tzlabel} [^1]
${_user.tzoffset} [^1]
${_user.realnamenormalized} [^1]
${_user.displayname} [^1]
${_user.displaynamenormalized} [^1]
${_user.skype} [^1]
${_user.phone} [^1]
${_user.title} [^1]
${_user.statustext} [^1]
${_user.statusemoji} [^1]
```

- [^1]: Only available for Slack, currently. See https://api.slack.com/types/user for more information

0 comments on commit df802eb

Please sign in to comment.