Skip to content

Commit bdf75d6

Browse files
committed
extract description message into constant
1 parent 1e555f3 commit bdf75d6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

components/slack_bot/common/utils.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import app from "../slack_bot.app.mjs";
22

3+
const CONVERSATION_PERMISSION_MESSAGE = "In order to list a Slack channel, **your bot must be a member of that channel**, and in order to list private channels, your bot must have the `groups:read` scope in the `OAuth & Permissions` settings in Slack for this bot.";
4+
35
async function streamIterator(stream) {
46
let resources = [];
57
for await (const resource of stream) {
@@ -24,10 +26,9 @@ function buildPropDefinitions({
2426
}
2527

2628
if (key === "conversation") {
27-
const message = "In order to list a Slack channel, **your bot must be a member of that channel**, and in order to list private channels, your bot must have the `groups:read` scope in the `OAuth & Permissions` settings in Slack for this bot.";
2829
prop.description = prop.description
29-
? `${prop.description} ${message}`
30-
: `Select a public or private channel, or a user or group. ${message}`;
30+
? `${prop.description} ${CONVERSATION_PERMISSION_MESSAGE}`
31+
: `Select a public or private channel, or a user or group. ${CONVERSATION_PERMISSION_MESSAGE}`;
3132
}
3233

3334
const [

0 commit comments

Comments
 (0)