Skip to content

haxiom/haxfred-slack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Haxfred-Slack

Integration between Haxfred and Slack

Config

The only required parameter is the Slack API token

{
  "slack_token": "your-slack-api-token"
}

Slack Events

slack.open

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
}

slack.directMsg

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
}

slack.message

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
}

slack.<message_sub_type>

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
}

Development

npm i

Testing

npm t

About

Haxfred integration with slack api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published