# hubot-mattermmost-attachment

> Re-enable `mattermmost-attachment` event for hubot-mattermmost

Latest version **1.0.3** (published 2016-09-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install hubot-mattermmost-attachment
pnpm add hubot-mattermmost-attachment
yarn add hubot-mattermmost-attachment
bun add hubot-mattermmost-attachment
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2016-09-10 |
| First published | 2016-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | someone |
| Maintainers | panjingping |
| Keywords | hubot, mattermmost |

## Links

- npm: https://www.npmjs.com/package/hubot-mattermmost-attachment
- Repository: https://github.com/inkel/hubot-mattermmost-attachment
- Issues: https://github.com/inkel/hubot-mattermmost-attachment/issues
- npm.io page: https://npm.io/package/hubot-mattermmost-attachment

## Dependencies (1)

- [coffee-script](https://npm.io/package/coffee-script.md) ~1.6

## Recent versions

- 1.0.3 (latest) — 2016-09-10
- 1.0.1 — 2016-09-10

## README

# Re-enable `slack-attachment` in [hubot-slack][hubot-slack]
When Slack introduced version 3 of their [hubot-slack][hubot-slack] adapter the old `slack-attachment` was removed due to [constraints in the RTM API](https://github.com/slackhq/hubot-slack/issues/108).

This module attempts to reintroduce the event using [Incoming Webhooks][incoming] to somehow replicate the lost feature.

To use again `slack-attachment` events, just run the following in your hubot repository:

```
npm install hubot-slack-attachment --save
```

And then add `hubot-slack-attachment` to `external-scripts.json`.

Last but not least, you need to add the environment variable `HUBOT_SLACK_INCOMING_WEBHOOK` to the URL for the new [incoming webhook][incoming] you've just defined.

## Usage

Emit a `slack.attachment` event with the following parameters:

```coffee
robot.emit 'slack.attachment',
  message: msg.message
  content:
    # see https://api.slack.com/docs/attachments
    text: "Attachment text"
    fallback: "Attachment fallback"
    fields: [{
      title: "Field title"
      value: "Field value"
    }]
  channel: "#general" # optional, defaults to message.room
  username: "foobot" # optional, defaults to robot.name
  icon_url: "..." # optional
  icon_emoji: "..." # optional
```

## Known Issues

* The user name sending the attachment will be `#{robot.name} (bot)`, so if your bot is named `hubot` it will appear as `hubot (bot)`

[hubot-slack]: https://github.com/slackhq/hubot-slack
[incoming]: https://my.slack.com/services/new/incoming-webhook

## Contributors

The following people deserve as much credit as I do for contributing to make this little project better:

* [Kevin Ballard](https://github.com/kballard)
* [Bojan Rajkovic](https://github.com/bojanrajkovic)
* [Ivan Buryak](https://github.com/11bit)

## License
This software is licensed under MIT License. See [LICENSE][LICENSE] for more details.

---
_Source: https://npm.io/package/hubot-mattermmost-attachment · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
