@hubot-friends/hubot-slack 0.0.0-development
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/CODE_OF_CONDUCT.md +11 -0
- package/.github/contributing.md +60 -0
- package/.github/issue_template.md +48 -0
- package/.github/maintainers_guide.md +91 -0
- package/.github/pull_request_template.md +8 -0
- package/.github/workflows/ci-build.yml +74 -0
- package/LICENSE +22 -0
- package/README.md +29 -0
- package/docs/Gemfile +2 -0
- package/docs/README.md +15 -0
- package/docs/_config.yml +29 -0
- package/docs/_includes/analytics.html +7 -0
- package/docs/_includes/head.html +33 -0
- package/docs/_includes/page_header.html +20 -0
- package/docs/_includes/side_nav.html +22 -0
- package/docs/_includes/tag_manager.html +13 -0
- package/docs/_layouts/changelog.html +15 -0
- package/docs/_layouts/default.html +47 -0
- package/docs/_layouts/page.html +10 -0
- package/docs/_pages/FAQ.md +63 -0
- package/docs/_pages/about.md +16 -0
- package/docs/_pages/advanced_usage.md +102 -0
- package/docs/_pages/auth.md +44 -0
- package/docs/_pages/basic_usage.md +302 -0
- package/docs/_pages/changelog.html +17 -0
- package/docs/_pages/upgrading.md +49 -0
- package/docs/_posts/2016-07-15-v4.0.0.md +14 -0
- package/docs/_posts/2016-07-19-v4.0.1.md +5 -0
- package/docs/_posts/2016-08-03-v4.0.2.md +4 -0
- package/docs/_posts/2016-09-12-v4.0.3.md +8 -0
- package/docs/_posts/2016-09-12-v4.0.4.md +4 -0
- package/docs/_posts/2016-09-14-v4.0.5.md +4 -0
- package/docs/_posts/2016-09-21-v4.1.0.md +4 -0
- package/docs/_posts/2016-10-12-v4.2.0.md +4 -0
- package/docs/_posts/2016-10-12-v4.2.1.md +4 -0
- package/docs/_posts/2016-11-05-v4.2.2.md +8 -0
- package/docs/_posts/2017-01-05-v4.3.0.md +5 -0
- package/docs/_posts/2017-01-09-v4.3.1.md +5 -0
- package/docs/_posts/2017-02-15-v4.3.2.md +5 -0
- package/docs/_posts/2017-02-17-v4.3.3.md +4 -0
- package/docs/_posts/2017-03-29-v4.3.4.md +5 -0
- package/docs/_posts/2017-08-24-v4.4.0.md +7 -0
- package/docs/_posts/2018-06-08-v4.5.0.md +13 -0
- package/docs/_posts/2018-06-14-v4.5.1.md +4 -0
- package/docs/_posts/2018-07-03-v4.5.2.md +5 -0
- package/docs/_posts/2018-07-17-v4.5.3.md +12 -0
- package/docs/_posts/2018-08-10-v4.5.4.md +7 -0
- package/docs/_posts/2018-10-01-v4.5.5.md +7 -0
- package/docs/_posts/2018-12-21-v4.6.0.md +6 -0
- package/docs/_posts/2019-04-29-v4.7.0.md +6 -0
- package/docs/_posts/2019-04-30-v4.7.1.md +5 -0
- package/docs/_posts/2020-04-03-v4.7.2.md +6 -0
- package/docs/_posts/2020-05-19-v4.8.0.md +10 -0
- package/docs/_posts/2020-10-19-v4.8.1.md +7 -0
- package/docs/_posts/2021-01-26-v4.9.0.md +8 -0
- package/docs/_posts/2022-01-12-v4.10.0.md +8 -0
- package/docs/index.md +93 -0
- package/docs/styles/docs.css +37 -0
- package/package.json +50 -0
- package/slack.js +20 -0
- package/src/SlackAdapter.mjs +302 -0
- package/src/SlackAdapter.test.mjs +342 -0
- package/src/bot.js +526 -0
- package/src/client.js +445 -0
- package/src/extensions.js +82 -0
- package/src/mention.js +15 -0
- package/src/message.js +307 -0
- package/src/testing.mjs +24 -0
- package/test/bot.js +769 -0
- package/test/client.js +446 -0
- package/test/message.js +329 -0
- package/test/stubs.js +388 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Introduction
|
|
4
|
+
|
|
5
|
+
Diversity and inclusion make our community strong. We encourage participation from the most varied and diverse backgrounds possible and want to be very clear about where we stand.
|
|
6
|
+
|
|
7
|
+
Our goal is to maintain a safe, helpful and friendly community for everyone, regardless of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other defining characteristic.
|
|
8
|
+
|
|
9
|
+
This code and related procedures also apply to unacceptable behavior occurring outside the scope of community activities, in all community venues (online and in-person) as well as in all one-on-one communications, and anywhere such behavior has the potential to adversely affect the safety and well-being of community members.
|
|
10
|
+
|
|
11
|
+
For more information on our code of conduct, please visit [https://slackhq.github.io/code-of-conduct](https://slackhq.github.io/code-of-conduct)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Contributors Guide
|
|
2
|
+
|
|
3
|
+
Interested in contributing? Awesome! Before you do though, please read our
|
|
4
|
+
[Code of Conduct](https://slackhq.github.io/code-of-conduct). We take it very seriously, and expect that you will as
|
|
5
|
+
well.
|
|
6
|
+
|
|
7
|
+
There are many ways you can contribute! :heart:
|
|
8
|
+
|
|
9
|
+
### Bug Reports and Fixes :bug:
|
|
10
|
+
- If you find a bug, please search for it in the [Issues](https://github.com/slackapi/hubot-slack/issues), and if it isn't already tracked,
|
|
11
|
+
[create a new issue](https://github.com/slackapi/hubot-slack/issues/new). Fill out the "Bug Report" section of the issue template. Even if an Issue is closed, feel free to comment and add details, it will still
|
|
12
|
+
be reviewed.
|
|
13
|
+
- Issues that have already been identified as a bug (note: able to reproduce) will be labelled `bug`.
|
|
14
|
+
- If you'd like to submit a fix for a bug, [send a Pull Request](#creating_a_pull_request) and mention the Issue number.
|
|
15
|
+
- Include tests that isolate the bug and verifies that it was fixed.
|
|
16
|
+
|
|
17
|
+
### New Features :bulb:
|
|
18
|
+
- If you'd like to add new functionality to this project, describe the problem you want to solve in a [new Issue](https://github.com/slackapi/hubot-slack/issues/new).
|
|
19
|
+
- Issues that have been identified as a feature request will be labelled `enhancement`.
|
|
20
|
+
- If you'd like to implement the new feature, please wait for feedback from the project
|
|
21
|
+
maintainers before spending too much time writing the code. In some cases, `enhancement`s may
|
|
22
|
+
not align well with the project objectives at the time.
|
|
23
|
+
|
|
24
|
+
### Tests :mag:, Documentation :books:, Miscellaneous :sparkles:
|
|
25
|
+
- If you'd like to improve the tests, you want to make the documentation clearer, you have an
|
|
26
|
+
alternative implementation of something that may have advantages over the way its currently
|
|
27
|
+
done, or you have any other change, we would be happy to hear about it!
|
|
28
|
+
- If its a trivial change, go ahead and [send a Pull Request](#creating_a_pull_request) with the changes you have in mind.
|
|
29
|
+
- If not, [open an Issue](https://github.com/slackapi/hubot-slack/issues/new) to discuss the idea first.
|
|
30
|
+
|
|
31
|
+
If you're new to our project and looking for some way to make your first contribution, look for
|
|
32
|
+
Issues labelled `good first contribution`.
|
|
33
|
+
|
|
34
|
+
## Requirements
|
|
35
|
+
|
|
36
|
+
For your contribution to be accepted:
|
|
37
|
+
|
|
38
|
+
- [x] You must have signed the [Contributor License Agreement (CLA)](https://cla-assistant.io/slackapi/hubot-slack).
|
|
39
|
+
- [x] The test suite must be complete and pass.
|
|
40
|
+
- [x] The changes must be approved by code review.
|
|
41
|
+
- [x] Commits should be atomic and messages must be descriptive. Related issues should be mentioned by Issue number.
|
|
42
|
+
|
|
43
|
+
If the contribution doesn't meet the above criteria, you may fail our automated checks or a maintainer will discuss it with you. You can continue to improve a Pull Request by adding commits to the branch from which the PR was created.
|
|
44
|
+
|
|
45
|
+
[Interested in knowing more about about pull requests at Slack?](https://slack.engineering/on-empathy-pull-requests-979e4257d158#.awxtvmb2z)
|
|
46
|
+
|
|
47
|
+
## Creating a Pull Request
|
|
48
|
+
|
|
49
|
+
1. :fork_and_knife: Fork the repository on GitHub.
|
|
50
|
+
2. :runner: Clone/fetch your fork to your local development machine. It's a good idea to run the tests just
|
|
51
|
+
to make sure everything is in order.
|
|
52
|
+
3. :herb: Create a new branch and check it out.
|
|
53
|
+
4. :crystal_ball: Make your changes and commit them locally. Magic happens here!
|
|
54
|
+
5. :arrow_heading_up: Push your new branch to your fork. (e.g. `git push username fix-issue-16`).
|
|
55
|
+
6. :inbox_tray: Open a Pull Request on github.com from your new branch on your fork to `master` in this
|
|
56
|
+
repository.
|
|
57
|
+
|
|
58
|
+
## Maintainers
|
|
59
|
+
|
|
60
|
+
There are more details about processes and workflow in the [Maintainer's Guide](./maintainers_guide.md).
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
### Description
|
|
2
|
+
|
|
3
|
+
Describe your issue here.
|
|
4
|
+
|
|
5
|
+
### What type of issue is this? (place an `x` in one of the `[ ]`)
|
|
6
|
+
- [ ] bug
|
|
7
|
+
- [ ] enhancement (feature request)
|
|
8
|
+
- [ ] question
|
|
9
|
+
- [ ] documentation related
|
|
10
|
+
- [ ] testing related
|
|
11
|
+
- [ ] discussion
|
|
12
|
+
|
|
13
|
+
### Requirements (place an `x` in each of the `[ ]`)
|
|
14
|
+
* [ ] I've read and understood the [Contributing guidelines](https://github.com/slackapi/hubot-slack/blob/master/.github/contributing.md) and have done my best effort to follow them.
|
|
15
|
+
* [ ] I've read and agree to the [Code of Conduct](https://slackhq.github.io/code-of-conduct).
|
|
16
|
+
* [ ] I've searched for any related issues and avoided creating a duplicate issue.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
### Bug Report
|
|
21
|
+
|
|
22
|
+
Filling out the following details about bugs will help us solve your issue sooner.
|
|
23
|
+
|
|
24
|
+
#### Reproducible in:
|
|
25
|
+
|
|
26
|
+
hubot-slack version:
|
|
27
|
+
|
|
28
|
+
node version:
|
|
29
|
+
|
|
30
|
+
OS version(s):
|
|
31
|
+
|
|
32
|
+
#### Steps to reproduce:
|
|
33
|
+
|
|
34
|
+
1.
|
|
35
|
+
2.
|
|
36
|
+
3.
|
|
37
|
+
|
|
38
|
+
#### Expected result:
|
|
39
|
+
|
|
40
|
+
What you expected to happen
|
|
41
|
+
|
|
42
|
+
#### Actual result:
|
|
43
|
+
|
|
44
|
+
What actually happened
|
|
45
|
+
|
|
46
|
+
#### Attachments:
|
|
47
|
+
|
|
48
|
+
Logs, screenshots, screencast, sample project, funny gif, etc.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Maintainers Guide
|
|
2
|
+
|
|
3
|
+
This document describes tools, tasks and workflow that one needs to be familiar with in order to effectively maintain
|
|
4
|
+
this project. If you use this package within your own software as is but don't plan on modifying it, this guide is
|
|
5
|
+
**not** for you.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
All you need to work with this project is a supported version of [Node.js](https://nodejs.org/en/)
|
|
10
|
+
(see `package.json` field "engines") and npm (which is distributed with Node.js).
|
|
11
|
+
|
|
12
|
+
## Tasks
|
|
13
|
+
|
|
14
|
+
### Testing
|
|
15
|
+
|
|
16
|
+
This package has unit tests for most modules (files) in the `test` directory. The structure mirrors the `src` directory closely. You can run the entire test suite using the npm script `npm test`. This command is also executed by Travis, the continuous integration service, for every Pull Request and branch. The coverage is computed with the `istanbul` package. The tests themselves are run using the `mocha` test runner.
|
|
17
|
+
|
|
18
|
+
Test code should be written in syntax that runs on the oldest supported Node.js version. This ensures that backwards compatibility is tested and the APIs look reasonable in versions of Node.js that do not support the most modern syntax.
|
|
19
|
+
|
|
20
|
+
### Generating Documentation
|
|
21
|
+
|
|
22
|
+
The source files are contained in the `docs` directory. The documentation is built using [Jekyll](https://jekyllrb.com/) and hosted with GitHub Pages. The documentation is built automatically with each
|
|
23
|
+
merge to `main` on GitHub.
|
|
24
|
+
|
|
25
|
+
### Releasing
|
|
26
|
+
|
|
27
|
+
1. Create the commit for the release:
|
|
28
|
+
* Bump the version number in adherence to [Semantic Versioning](http://semver.org/) in `package.json`.
|
|
29
|
+
* Add a changelog entry. Release notes should mention contributors (@-mentions) and issues/PRs (#-mentions). An entry is a new file in `docs/_posts`.
|
|
30
|
+
* Commit with a message including the new version number. For example `v1.0.8`.
|
|
31
|
+
* Tag the commit with the version number. For example `v1.0.8`.
|
|
32
|
+
|
|
33
|
+
2. Merge into main repository
|
|
34
|
+
* Create a pull request with the commit that was just made. Be certain to include the tag. For
|
|
35
|
+
example: `git push username main:rel-v1.0.8 && git push --tags username`.
|
|
36
|
+
* Once tests pass and a reviewer has approved, merge the pull request. You will also want to
|
|
37
|
+
update your local `main` branch.
|
|
38
|
+
|
|
39
|
+
3. Distribute the release
|
|
40
|
+
* Publish to the package manager. Once you have permission to publish on npm, you can run `npm publish`.
|
|
41
|
+
* Create a GitHub Release. Reuse the release notes written for the changelog entry.
|
|
42
|
+
|
|
43
|
+
4. (Slack Internal) Communicate the release internally. Include a link to the GitHub Release.
|
|
44
|
+
|
|
45
|
+
5. Announce on Slack Team dev4slack in #slack-api
|
|
46
|
+
|
|
47
|
+
6. (Slack Internal) Tweet? Not necessary for patch updates, might be needed for minor updates,
|
|
48
|
+
definitely needed for major updates. Include a link to the GitHub Release.
|
|
49
|
+
|
|
50
|
+
## Workflow
|
|
51
|
+
|
|
52
|
+
### Versioning and Tags
|
|
53
|
+
|
|
54
|
+
This project is versioned using [Semantic Versioning](http://semver.org/), particularly in the
|
|
55
|
+
[npm flavor](https://docs.npmjs.com/getting-started/semantic-versioning). Each release is tagged
|
|
56
|
+
using git.
|
|
57
|
+
|
|
58
|
+
### Branches
|
|
59
|
+
|
|
60
|
+
`main` is where active development occurs. Long running named feature branches are occasionally
|
|
61
|
+
created for collaboration on a feature that has a large scope (because everyone cannot push commits
|
|
62
|
+
to another person's open Pull Request). At some point in the future after a major version increment,
|
|
63
|
+
there may be maintenance branches for older major versions.
|
|
64
|
+
|
|
65
|
+
### Issue Management
|
|
66
|
+
|
|
67
|
+
Labels are used to run issues through an organized workflow. Here are the basic definitions:
|
|
68
|
+
|
|
69
|
+
* `bug`: A confirmed bug report. A bug is considered confirmed when reproduction steps have been
|
|
70
|
+
documented and the issue has been reproduced.
|
|
71
|
+
* `enhancement`: A feature request for something this package might not already do.
|
|
72
|
+
* `docs`: An issue that is purely about documentation work.
|
|
73
|
+
* `tests`: An issue that is purely about testing work.
|
|
74
|
+
* `needs feedback`: An issue that may have claimed to be a bug but was not reproducible, or was otherwise missing some information.
|
|
75
|
+
* `discussion`: An issue that is purely meant to hold a discussion. Typically the maintainers are looking for feedback in this issues.
|
|
76
|
+
* `question`: An issue that is like a support request because the user's usage was not correct.
|
|
77
|
+
* `semver:major|minor|patch`: Metadata about how resolving this issue would affect the version number.
|
|
78
|
+
* `security`: An issue that has special consideration for security reasons.
|
|
79
|
+
* `good first contribution`: An issue that has a well-defined relatively-small scope, with clear expectations. It helps when the testing approach is also known.
|
|
80
|
+
* `duplicate`: An issue that is functionally the same as another issue. Apply this only if you've linked the other issue by number.
|
|
81
|
+
|
|
82
|
+
**Triage** is the process of taking new issues that aren't yet "seen" and marking them with a basic
|
|
83
|
+
level of information with labels. An issue should have **one** of the following labels applied:
|
|
84
|
+
`bug`, `enhancement`, `question`, `needs feedback`, `docs`, `tests`, or `discussion`.
|
|
85
|
+
|
|
86
|
+
Issues are closed when a resolution has been reached. If for any reason a closed issue seems
|
|
87
|
+
relevant once again, reopening is great and better than creating a duplicate issue.
|
|
88
|
+
|
|
89
|
+
## Everything else
|
|
90
|
+
|
|
91
|
+
When in doubt, find the other maintainers and ask.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
### Summary
|
|
2
|
+
|
|
3
|
+
Describe the goal of this PR. Mention any related Issue numbers.
|
|
4
|
+
|
|
5
|
+
### Requirements (place an `x` in each `[ ]`)
|
|
6
|
+
|
|
7
|
+
* [ ] I've read and understood the [Contributing Guidelines](https://github.com/slackapi/hubot-slack/blob/master/.github/contributing.md) and have done my best effort to follow them.
|
|
8
|
+
* [ ] I've read and agree to the [Code of Conduct](https://slackhq.github.io/code-of-conduct).
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
name: Hubot Slack Adapter CI Builds
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [ main ]
|
|
5
|
+
pull_request:
|
|
6
|
+
branches: [ main ]
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
issues: write
|
|
10
|
+
pull-requests: write
|
|
11
|
+
id-token: write
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
name: Build
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
node-version: ['lts/*']
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout
|
|
21
|
+
uses: actions/checkout@v3
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0
|
|
24
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
25
|
+
uses: actions/setup-node@v3
|
|
26
|
+
with:
|
|
27
|
+
node-version: ${{ matrix.node-version }}
|
|
28
|
+
cache: 'npm'
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: npm ci
|
|
31
|
+
- name: Install hubot
|
|
32
|
+
run: npm i hubot@5.x
|
|
33
|
+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
|
|
34
|
+
run: npm audit signatures
|
|
35
|
+
test:
|
|
36
|
+
name: Fast Tests
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
needs: build
|
|
39
|
+
strategy:
|
|
40
|
+
matrix:
|
|
41
|
+
node-version: ['lts/*']
|
|
42
|
+
steps:
|
|
43
|
+
- name: Checkout
|
|
44
|
+
uses: actions/checkout@v3
|
|
45
|
+
with:
|
|
46
|
+
fetch-depth: 0
|
|
47
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
48
|
+
uses: actions/setup-node@v3
|
|
49
|
+
with:
|
|
50
|
+
node-version: ${{ matrix.node-version }}
|
|
51
|
+
cache: 'npm'
|
|
52
|
+
- run: npm ci
|
|
53
|
+
- run: npm i hubot@5.x
|
|
54
|
+
- run: npm test
|
|
55
|
+
release:
|
|
56
|
+
needs: [build, test]
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
strategy:
|
|
59
|
+
matrix:
|
|
60
|
+
node-version: ['lts/*']
|
|
61
|
+
if: github.ref == 'refs/heads/main' && ${{ success() }}
|
|
62
|
+
steps:
|
|
63
|
+
- name: Checkout
|
|
64
|
+
uses: actions/checkout@v3
|
|
65
|
+
- name: Set up Node.js
|
|
66
|
+
uses: actions/setup-node@v3
|
|
67
|
+
with:
|
|
68
|
+
node-version: ${{ matrix.node-version }}
|
|
69
|
+
cache: 'npm'
|
|
70
|
+
- name: Release
|
|
71
|
+
env:
|
|
72
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
73
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
74
|
+
run: npx semantic-release
|
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014- Slack Technologies, LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# hubot-slack
|
|
2
|
+
|
|
3
|
+
### Important Notice
|
|
4
|
+
|
|
5
|
+
**The original hubot-slack is no longer under active development.** Slack recommands taking a look at [Bolt for JS with Socket Mode](https://slack.dev/bolt-js/concepts#socket-mode) first if you're getting started.
|
|
6
|
+
|
|
7
|
+
But I'm going to maintain this fork as I continue to evolve Hubot. So feel free to use this one.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm i hubot-new/hubot-slack
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This is a [Hubot](http://hubot.github.com/) adapter to use with [Slack](https://slack.com).
|
|
16
|
+
|
|
17
|
+
Comprehensive documentation [is available](https://slackapi.github.io/hubot-slack).
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# Notes on using SocketMode
|
|
21
|
+
|
|
22
|
+
Need the following permissions:
|
|
23
|
+
- app_mentions:read
|
|
24
|
+
- channels:join
|
|
25
|
+
- chat:write
|
|
26
|
+
- im:write
|
|
27
|
+
|
|
28
|
+
Need the following *Bot Token Scopes*:
|
|
29
|
+
- users:read
|
package/docs/Gemfile
ADDED
package/docs/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Run the website on your local machine
|
|
2
|
+
|
|
3
|
+
```bash
|
|
4
|
+
brew install rbenv # https://github.com/rbenv/rbenv
|
|
5
|
+
rbenv init
|
|
6
|
+
|
|
7
|
+
rbenv install 2.6.5
|
|
8
|
+
rbenv local 2.6.5
|
|
9
|
+
rbenv rehash
|
|
10
|
+
|
|
11
|
+
gem install bundler
|
|
12
|
+
bundle install
|
|
13
|
+
bundle exec jekyll serve -It
|
|
14
|
+
open http://127.0.0.1:4000/hubot-slack/
|
|
15
|
+
```
|
package/docs/_config.yml
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Welcome to Jekyll!
|
|
2
|
+
#
|
|
3
|
+
# This config file is meant for settings that affect your whole blog, values
|
|
4
|
+
# which you are expected to set up once and rarely need to edit after that.
|
|
5
|
+
# For technical reasons, this file is *NOT* reloaded automatically when you use
|
|
6
|
+
# 'jekyll serve'. If you change this file, please restart the server process.
|
|
7
|
+
|
|
8
|
+
# Site settings
|
|
9
|
+
product_name: &product_name Slack Developer Kit for Hubot
|
|
10
|
+
title: *product_name
|
|
11
|
+
email: opensource@slack.com
|
|
12
|
+
description: >
|
|
13
|
+
Write Hubot scripts to run in your Slack team.
|
|
14
|
+
baseurl: /hubot-slack
|
|
15
|
+
url: http://slack.dev
|
|
16
|
+
repo_name: hubot-slack
|
|
17
|
+
dev4slack_channel: sdk-hubot-slack
|
|
18
|
+
twitter_username: SlackAPI
|
|
19
|
+
github_username: SlackAPI
|
|
20
|
+
|
|
21
|
+
google_analytics: UA-56978219-13
|
|
22
|
+
google_tag_manager: GTM-KFZ5MK7
|
|
23
|
+
|
|
24
|
+
include: ['_pages']
|
|
25
|
+
|
|
26
|
+
# Build settings
|
|
27
|
+
markdown: kramdown
|
|
28
|
+
plugins:
|
|
29
|
+
- jemoji
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<head>
|
|
2
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
|
|
3
|
+
|
|
4
|
+
<title>Slack | {% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
|
|
5
|
+
<meta name="author" content="Slack">
|
|
6
|
+
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
|
|
7
|
+
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
|
|
8
|
+
<link href="https://a.slack-edge.com/4f227/style/rollup-slack_kit_legacy_adapters.css" rel="stylesheet" type="text/css">
|
|
9
|
+
<link href="https://a.slack-edge.com/3e02c0/style/rollup-api_site.css" rel="stylesheet" type="text/css">
|
|
10
|
+
<link href="styles/docs.css" rel="stylesheet" type="text/css">
|
|
11
|
+
|
|
12
|
+
<meta name="HandheldFriendly" content="true"/>
|
|
13
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
14
|
+
|
|
15
|
+
<!--[if lt IE 9]>
|
|
16
|
+
<script src="https://a.slack-edge.com/ef0d/js/libs/html5shiv.js"></script>
|
|
17
|
+
<![endif]-->
|
|
18
|
+
|
|
19
|
+
<link id="favicon" rel="shortcut icon" href="https://a.slack-edge.com/4f28/img/icons/favicon-32.png" sizes="16x16 32x32 48x48" type="image/png" />
|
|
20
|
+
|
|
21
|
+
<link rel="icon" href="https://a.slack-edge.com/4f28/img/icons/app-256.png" sizes="256x256" type="image/png" />
|
|
22
|
+
|
|
23
|
+
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="https://a.slack-edge.com/4f28/img/icons/ios-152.png" />
|
|
24
|
+
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="https://a.slack-edge.com/4f28/img/icons/ios-144.png" />
|
|
25
|
+
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="https://a.slack-edge.com/4f28/img/icons/ios-120.png" />
|
|
26
|
+
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="https://a.slack-edge.com/4f28/img/icons/ios-114.png" />
|
|
27
|
+
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="https://a.slack-edge.com/4f28/img/icons/ios-72.png" />
|
|
28
|
+
<link rel="apple-touch-icon-precomposed" href="https://a.slack-edge.com/4f28/img/icons/ios-57.png" />
|
|
29
|
+
|
|
30
|
+
<meta name="msapplication-TileColor" content="#FFFFFF" />
|
|
31
|
+
<meta name="msapplication-TileImage" content="https://a.slack-edge.com/4f28/img/icons/app-144.png" />
|
|
32
|
+
|
|
33
|
+
</head>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{% include tag_manager.html %}
|
|
2
|
+
|
|
3
|
+
<header>
|
|
4
|
+
<a id="menu_toggle" class="no_transition show_on_mobile">
|
|
5
|
+
<span class="menu_icon"></span>
|
|
6
|
+
<span class="vert_divider"></span>
|
|
7
|
+
</a>
|
|
8
|
+
|
|
9
|
+
<a href="https://api.slack.com/" id="header_logo" class="api hide_on_mobile" style="float:left; display: inline-block;">
|
|
10
|
+
<img alt="Slack API" src="https://a.slack-edge.com/3026cb/img/slack_api_logo_vogue.png" style="width: 225px; padding-right: 25px; border-right: 1px solid #DDD;" />
|
|
11
|
+
</a>
|
|
12
|
+
<span style="display: inline-block; padding-left: 20px; margin-top: 25px; font-weight: bold;">
|
|
13
|
+
<a style="color: #555459;" href="{{ site.baseurl | prepend: site.url }}/">{{ site.title | escape }}</a>
|
|
14
|
+
</span>
|
|
15
|
+
|
|
16
|
+
<div class="header_nav">
|
|
17
|
+
<a href="https://github.com/{{ site.github_username }}/{{ site.repo_name }}" class="btn header_btn float_right"
|
|
18
|
+
data-qa="go_to_slack">Go to GitHub</a>
|
|
19
|
+
</div>
|
|
20
|
+
</header>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<div id="api_sections">
|
|
2
|
+
|
|
3
|
+
{% assign sorted_pages = site.pages | where_exp:"page", "page.name != 'style.scss'" | where_exp:"page", "page.name != 'docs.css'" | sort:"order" %}
|
|
4
|
+
|
|
5
|
+
{% for node in sorted_pages %}
|
|
6
|
+
{% if node.hidden != true %}
|
|
7
|
+
<div class="sidebar_menu">
|
|
8
|
+
<h5><a href="{{ node.url | prepend: site.baseurl }}" class="{% if page.url == node.url %}is_active{% endif %}">{% if node.title %}{{ node.title }}{% else %}{{ site.title }}{% endif %}</a></h5>
|
|
9
|
+
<ul class="sidebar_menu_list">
|
|
10
|
+
{% if node.headings %}
|
|
11
|
+
{% for heading in node.headings %}
|
|
12
|
+
{% assign anchor = heading.title | downcase | replace: " ", "-" | remove: ":" | remove: "," | remove: "'" | remove: "." | remove: "?" | remove: "!" %}
|
|
13
|
+
<li><a href="{{ node.url | prepend: site.baseurl }}#{{ anchor }}" class="sidebar_menu_list_item">{{ heading.title }}</a></li>
|
|
14
|
+
{% endfor %}
|
|
15
|
+
{% endif %}
|
|
16
|
+
|
|
17
|
+
</ul>
|
|
18
|
+
</div>
|
|
19
|
+
{% endif %}
|
|
20
|
+
{% endfor %}
|
|
21
|
+
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Google Tag Manager -->
|
|
2
|
+
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
3
|
+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
4
|
+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
5
|
+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
6
|
+
})(window,document,'script','dataLayer','{{ site.google_tag_manager }}');</script>
|
|
7
|
+
<!-- End Google Tag Manager -->
|
|
8
|
+
|
|
9
|
+
<!-- Google Tag Manager (noscript) -->
|
|
10
|
+
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ site.google_tag_manager }}"
|
|
11
|
+
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
|
12
|
+
<!-- End Google Tag Manager (noscript) -->
|
|
13
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: default
|
|
3
|
+
---
|
|
4
|
+
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
|
|
5
|
+
|
|
6
|
+
<header class="post-header">
|
|
7
|
+
<h1 class="post-title" itemprop="name headline">{{ page.title }}</h1>
|
|
8
|
+
<p class="post-meta"><time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ page.date | date: "%b %-d, %Y" }}</time>{% if page.author %} • <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ page.author }}</span></span>{% endif %}</p>
|
|
9
|
+
</header>
|
|
10
|
+
|
|
11
|
+
<div class="post-content" itemprop="articleBody">
|
|
12
|
+
{{ content }}
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
</article>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
{% include head.html %}
|
|
5
|
+
|
|
6
|
+
<body class="api feature_related_content">
|
|
7
|
+
|
|
8
|
+
{% include page_header.html %}
|
|
9
|
+
|
|
10
|
+
<div id="page">
|
|
11
|
+
|
|
12
|
+
<div id="page_contents" class="clearfix">
|
|
13
|
+
<nav id="api_nav" class="col span_1_of_4">
|
|
14
|
+
|
|
15
|
+
{% include side_nav.html %}
|
|
16
|
+
|
|
17
|
+
<div class="sidebar_menu">
|
|
18
|
+
|
|
19
|
+
<ul class="sidebar_menu_list footer_nav">
|
|
20
|
+
<li><a href="https://github.com/{{ site.github_username }}/{{ site.repo_name }}/blob/master/LICENSE">License</a></li>
|
|
21
|
+
<li><a href="https://slackhq.github.io/code-of-conduct">Code of Conduct</a></li>
|
|
22
|
+
<li><a href="https://github.com/{{ site.github_username }}/{{ site.repo_name }}/blob/main/.github/contributing.md">Contributing</a></li>
|
|
23
|
+
<li><a href="https://docs.google.com/a/slack-corp.com/forms/d/e/1FAIpQLSfzjVoCM7ohBnjWf7eDYQxzti1EPpinsIJQA5RAUBwJKRUQHg/viewform">Contributor License Agreement</a></li>
|
|
24
|
+
</ul>
|
|
25
|
+
|
|
26
|
+
<p id="footer_signature">Made with <i class="ts_icon ts_icon_heart"></i> by Slack<br/>and our Lovely
|
|
27
|
+
Community
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
</nav>
|
|
33
|
+
|
|
34
|
+
<div class="col span_3_of_4">
|
|
35
|
+
{{ content }}
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<footer>
|
|
41
|
+
<p class="light tiny align_center">© 2019- Slack Technologies, LLC and contributors</p>
|
|
42
|
+
</footer>
|
|
43
|
+
|
|
44
|
+
{% include analytics.html %}
|
|
45
|
+
|
|
46
|
+
</body>
|
|
47
|
+
</html>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: page
|
|
3
|
+
title: Frequently Asked Questions
|
|
4
|
+
permalink: /faq
|
|
5
|
+
hidden: true
|
|
6
|
+
order: 6
|
|
7
|
+
headings:
|
|
8
|
+
- title: What even is this?
|
|
9
|
+
- title: OMG I found a bug!
|
|
10
|
+
- title: Hey, there's a feature missing!
|
|
11
|
+
- title: I'd like to contribute...but how?
|
|
12
|
+
- title: How do I compile the documentation?
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## What even is this?
|
|
16
|
+
|
|
17
|
+
{{ site.product_name }} is an adapter that allows you to connect Hubot to Slack. In addition to making it easy to run
|
|
18
|
+
your Hubot scripts in Slack, it also provides basic mechanisms for using the Slack Web API.
|
|
19
|
+
|
|
20
|
+
On the other hand, {{ site.product_name }} is _not_ a high-level bot development framework, nor is it, really, the best
|
|
21
|
+
way to get started writing a Slack App. If you are interested in building Slack bots for widespread distribution in
|
|
22
|
+
JavaScript, maybe you should have a look at [BotKit](https://howdy.ai/botkit/) or [Slapp](https://github.com/BeepBoopHQ/slapp).
|
|
23
|
+
|
|
24
|
+
## OMG I found a bug!
|
|
25
|
+
|
|
26
|
+
Well, poop. Take a deep breath, and then let us know by
|
|
27
|
+
[opening an issue](https://github.com/{{ site.github_username }}/{{ site.repo_name }}/issues). If you're feeling
|
|
28
|
+
particularly ambitious, why not
|
|
29
|
+
[submit a bugfix?](https://github.com/{{ site.github_username }}/{{ site.repo_name }}/pulls).
|
|
30
|
+
|
|
31
|
+
## Hey, there's a feature missing!
|
|
32
|
+
|
|
33
|
+
There's always something more that could be added! You can
|
|
34
|
+
[open an issue](https://github.com/{{ site.github_username }}/{{ site.repo_name }}/issues) to start a discussion around
|
|
35
|
+
the feature, that's a good start. If you're feeling particularly ambitious, why not write the feature yourself, and
|
|
36
|
+
[submit a PR!](https://github.com/{{ site.github_username }}/{{ site.repo_name }}/pulls). We love feedback and we love
|
|
37
|
+
help and we don't bite. Much.
|
|
38
|
+
|
|
39
|
+
## I'd like to contribute...but how?
|
|
40
|
+
|
|
41
|
+
What an excellent question. First of all, please have a look at our general
|
|
42
|
+
[contributing guidelines](https://github.com/{{ site.github_username }}/{{ site.repo_name }}/blob/master/.github/contributing.md).
|
|
43
|
+
We'll wait for you here.
|
|
44
|
+
|
|
45
|
+
All done? Great! While we're super excited to incorporate your new feature into {{ site.product_name }}, there are a
|
|
46
|
+
couple of things we want to make sure you've given thought to.
|
|
47
|
+
|
|
48
|
+
* Please write unit tests for your new code. But don't _just_ aim to increase the test coverage, rather, we expect you
|
|
49
|
+
to have written _thoughtful_ tests that ensure your new feature will continue to work as expected, and to help future
|
|
50
|
+
contributors to ensure they don't break it!
|
|
51
|
+
* Please document your new feature. Think about _concrete use cases_ for your feature, and add a section to the
|
|
52
|
+
appropriate document (probably
|
|
53
|
+
"[basic_usage.md](https://github.com/{{ site.github_username }}/{{ site.repo_name }}/blob/master/docs/_pages/basic_usage.md)"),
|
|
54
|
+
including a _complete_ sample program that demonstrates your feature.
|
|
55
|
+
|
|
56
|
+
Including these two items with your pull request will totally make our day—and, more importantly, your future users' days!
|
|
57
|
+
|
|
58
|
+
On that note...
|
|
59
|
+
|
|
60
|
+
## How do I compile the documentation?
|
|
61
|
+
|
|
62
|
+
If you are editing one of the many markdown files in the `docs` folder, there is nothing you need to do: GitHub will
|
|
63
|
+
do the right thing automatically. Hooray!
|