Integration between Haxfred and Slack
The only required parameter is the Slack API token
{
"slack_token": "your-slack-api-token"
}
Fired when haxfred has successfully connected to slack. Emits the public channels and private groups that Haxfred is a part of.
{
channels: channelObject,
groups: groupObject
}
Fired when someone speaks directly to Haxfred in a public channel or private group using the @username syntax. IE:
You: @haxfred: Hi haxfred!
You: @haxfred Hi haxfred!
You: I think @haxfred is great
Not
You: haxfred: Hi haxfred!
You: haxfred Hi haxfred!
You: I think haxfred is great
Haxfred will emit slack.directMsg
with the message object from slack
{
message: theDirectMessageObject
}
Fired when someone posts a message in a channel where the bot is a member that is not a direct message to the bot. Haxfred will emit the message object
{
message: theMessageObject
}
Some messages can have a subtype field. If a subtype exists, Haxfred will emit that event instead of the main message event. A few notable subtypes are:
- bot_message: A message was posted by an integration (Haxfred's messages will be of this type)
- channel_*: Messages related to actions in a public channel (joining, leaving, renaming, etc)
- group_*: Messages related to actions in a private group (joining, leaving, renaming, etc)
- file_*: Messages related to actions around sharing a file (sharing, commenting, mentioning)
For a full list of subtypes, do a search for "Message subtypes" on the Slack API document for messages.
Note: some subtypes have a boolean field hidden, which indicates that the message (such as deleting a message) should not be displayed to the user. Search for "Hidden subtypes" on the Slack API document for messages for more details.
{
message: theSubtypeMessage
}
npm i
npm t