@hubot-friends/hubot-slack 1.0.7 → 1.0.8
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/README.md +66 -2
- package/package.json +1 -1
- package/src/SlackAdapter.mjs +0 -3
- package/src/bot.js +2 -1
package/README.md
CHANGED
|
@@ -22,8 +22,72 @@ Comprehensive documentation [is available](https://slackapi.github.io/hubot-slac
|
|
|
22
22
|
Need the following permissions:
|
|
23
23
|
- app_mentions:read
|
|
24
24
|
- channels:join
|
|
25
|
+
- channels:history
|
|
26
|
+
- channels:read
|
|
25
27
|
- chat:write
|
|
26
28
|
- im:write
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
- im:history
|
|
30
|
+
- im:read
|
|
29
31
|
- users:read
|
|
32
|
+
- groups:history
|
|
33
|
+
- groups:write
|
|
34
|
+
- groups:read
|
|
35
|
+
- mpim:history
|
|
36
|
+
- mpim:write
|
|
37
|
+
- mpim:read
|
|
38
|
+
|
|
39
|
+
Need to following events:
|
|
40
|
+
- app_mention
|
|
41
|
+
- message.channels
|
|
42
|
+
- message.im
|
|
43
|
+
- message.groups
|
|
44
|
+
- message.mpim
|
|
45
|
+
|
|
46
|
+
## Sample YAML
|
|
47
|
+
The following YAML manifest will work.
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
display_information:
|
|
51
|
+
name: NameOfYourBot
|
|
52
|
+
description: Description of your bot.
|
|
53
|
+
background_color: "#3d001d"
|
|
54
|
+
features:
|
|
55
|
+
app_home:
|
|
56
|
+
home_tab_enabled: false
|
|
57
|
+
messages_tab_enabled: true
|
|
58
|
+
messages_tab_read_only_enabled: false
|
|
59
|
+
bot_user:
|
|
60
|
+
display_name: NameOfYourbot
|
|
61
|
+
always_online: true
|
|
62
|
+
oauth_config:
|
|
63
|
+
scopes:
|
|
64
|
+
bot:
|
|
65
|
+
- app_mentions:read
|
|
66
|
+
- channels:join
|
|
67
|
+
- channels:history
|
|
68
|
+
- channels:read
|
|
69
|
+
- chat:write
|
|
70
|
+
- im:write
|
|
71
|
+
- im:history
|
|
72
|
+
- im:read
|
|
73
|
+
- users:read
|
|
74
|
+
- groups:history
|
|
75
|
+
- groups:write
|
|
76
|
+
- groups:read
|
|
77
|
+
- mpim:history
|
|
78
|
+
- mpim:write
|
|
79
|
+
- mpim:read
|
|
80
|
+
settings:
|
|
81
|
+
event_subscriptions:
|
|
82
|
+
bot_events:
|
|
83
|
+
- app_mention
|
|
84
|
+
- message.channels
|
|
85
|
+
- message.im
|
|
86
|
+
- message.groups
|
|
87
|
+
- message.mpim
|
|
88
|
+
interactivity:
|
|
89
|
+
is_enabled: true
|
|
90
|
+
org_deploy_enabled: false
|
|
91
|
+
socket_mode_enabled: true
|
|
92
|
+
token_rotation_enabled: false
|
|
93
|
+
```
|
package/package.json
CHANGED
package/src/SlackAdapter.mjs
CHANGED
|
@@ -211,9 +211,6 @@ class SlackAdapter extends Adapter {
|
|
|
211
211
|
return text
|
|
212
212
|
}
|
|
213
213
|
async #onMessage(message) {
|
|
214
|
-
const channelResponse = await this.#webClient.conversations.info({
|
|
215
|
-
channel: message.event.channel
|
|
216
|
-
})
|
|
217
214
|
const slackMessage = new SlackResponse(message)
|
|
218
215
|
if(slackMessage.body.event.botId && slackMessage.body.event.user === this.robot.self.id) {
|
|
219
216
|
this.robot.logger.info('Ignoring message from self')
|
package/src/bot.js
CHANGED
|
@@ -82,7 +82,8 @@ class SlackClient {
|
|
|
82
82
|
}
|
|
83
83
|
this.robot.logger.debug(`SlackClient#send() room: ${room}, message: ${message}`);
|
|
84
84
|
if (typeof message !== "string") {
|
|
85
|
-
|
|
85
|
+
message.channel = room
|
|
86
|
+
return this.web.chat.postMessage(message).then(result => {
|
|
86
87
|
this.robot.logger.debug(`Successfully sent message to ${room}`)
|
|
87
88
|
}).catch(e => this.robot.logger.error(e, `SlackClient#send(message) error: ${e.message}`))
|
|
88
89
|
} else {
|