{"id":15813395,"url":"https://github.com/rohitjmathew/hubot-slack-attachment-optimised","last_synced_at":"2026-05-05T05:32:30.632Z","repository":{"id":57269301,"uuid":"189393928","full_name":"rohitjmathew/hubot-slack-attachment-optimised","owner":"rohitjmathew","description":"Re-enable `slack-attachment` event for hubot-slack","archived":false,"fork":false,"pushed_at":"2019-05-30T20:19:04.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-06T04:01:54.423Z","etag":null,"topics":["coffeescript","hubot","slack"],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rohitjmathew.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-30T10:28:13.000Z","updated_at":"2021-12-16T04:21:33.000Z","dependencies_parsed_at":"2022-09-02T02:50:37.328Z","dependency_job_id":null,"html_url":"https://github.com/rohitjmathew/hubot-slack-attachment-optimised","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohitjmathew%2Fhubot-slack-attachment-optimised","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohitjmathew%2Fhubot-slack-attachment-optimised/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohitjmathew%2Fhubot-slack-attachment-optimised/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohitjmathew%2Fhubot-slack-attachment-optimised/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rohitjmathew","download_url":"https://codeload.github.com/rohitjmathew/hubot-slack-attachment-optimised/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246563384,"owners_count":20797446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coffeescript","hubot","slack"],"created_at":"2024-10-05T04:01:54.021Z","updated_at":"2026-05-05T05:32:25.601Z","avatar_url":"https://github.com/rohitjmathew.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Re-enable `slack-attachment` in [hubot-slack][hubot-slack]\nWhen 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 is a personalised implementation of [hubot-slack-attachment](https://github.com/inkel/hubot-slack-attachment).\n\nThis module attempts to reintroduce the event using [Incoming Webhooks][incoming] to somehow replicate the lost feature.\n\nTo use again `slack-attachment` events, just run the following in your hubot repository:\n\n```\nnpm install hubot-slack-attachment-optimised --save\n```\n\nAnd then add `hubot-slack-attachment-optimised` to `external-scripts.json`.\n\nLast 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.\n\n## Usage\n\nEmit a `slack.attachment` event with the following parameters:\n\n```coffee\nrobot.emit 'slack.attachment',\n  message: msg.message\n  content:\n    # see https://api.slack.com/docs/attachments\n    text: \"Attachment text\"\n    fallback: \"Attachment fallback\"\n    fields: [{\n      title: \"Field title\"\n      value: \"Field value\"\n    }]\n  channel: \"#general\" # optional, defaults to message.room\n  username: \"foobot\" # optional, defaults to robot.name\n  icon_url: \"...\" # optional\n  icon_emoji: \"...\" # optional\n```\n\n## Known Issues\n\n* The user name sending the attachment will be `#{robot.name} (bot)`, so if your bot is named `hubot` it will appear as `hubot (bot)`\n\n[hubot-slack]: https://github.com/slackhq/hubot-slack\n[incoming]: https://my.slack.com/services/new/incoming-webhook\n\n## License\nThis software is licensed under MIT License. See [LICENSE][LICENSE] for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohitjmathew%2Fhubot-slack-attachment-optimised","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frohitjmathew%2Fhubot-slack-attachment-optimised","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohitjmathew%2Fhubot-slack-attachment-optimised/lists"}