Merge pull request #2297 from alipgoldberg/setup/slack-card-link-position
setup: tidy Slack app-creation card
This commit is contained in:
@@ -27,7 +27,7 @@ import k from 'kleur';
|
|||||||
import * as setupLog from '../logs.js';
|
import * as setupLog from '../logs.js';
|
||||||
import { BACK_TO_CHANNEL_SELECTION, type ChannelFlowResult } from '../lib/back-nav.js';
|
import { BACK_TO_CHANNEL_SELECTION, type ChannelFlowResult } from '../lib/back-nav.js';
|
||||||
import { brightSelect } from '../lib/bright-select.js';
|
import { brightSelect } from '../lib/bright-select.js';
|
||||||
import { formatNoteLink, openUrl } from '../lib/browser.js';
|
import { openUrl } from '../lib/browser.js';
|
||||||
import { isHeadless } from '../platform.js';
|
import { isHeadless } from '../platform.js';
|
||||||
import { askOperatorRole } from '../lib/role-prompt.js';
|
import { askOperatorRole } from '../lib/role-prompt.js';
|
||||||
import { ensureAnswer, fail, runQuietChild } from '../lib/runner.js';
|
import { ensureAnswer, fail, runQuietChild } from '../lib/runner.js';
|
||||||
@@ -126,22 +126,31 @@ export async function runSlackChannel(displayName: string): Promise<ChannelFlowR
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function walkThroughAppCreation(): Promise<'continue' | 'back'> {
|
async function walkThroughAppCreation(): Promise<'continue' | 'back'> {
|
||||||
|
// Bright-white ANSI overrides the surrounding brand-cyan from `note()`'s
|
||||||
|
// per-line formatter so the URL stands out against the rest of the body.
|
||||||
|
const linkBlock = isHeadless()
|
||||||
|
? [`\x1b[97mGet started: ${SLACK_APPS_URL}\x1b[39m`, '']
|
||||||
|
: [];
|
||||||
|
|
||||||
note(
|
note(
|
||||||
[
|
[
|
||||||
"You'll create a Slack app that the assistant talks through.",
|
"You'll create a Slack app that the assistant talks through.",
|
||||||
"Free and stays inside the workspaces you pick.",
|
"Free and stays inside the workspaces you pick.",
|
||||||
'',
|
'',
|
||||||
|
...linkBlock,
|
||||||
' 1. Create a new app "From scratch", name it, pick a workspace',
|
' 1. Create a new app "From scratch", name it, pick a workspace',
|
||||||
' 2. OAuth & Permissions → add Bot Token Scopes:',
|
' 2. OAuth & Permissions → add Bot Token Scopes:',
|
||||||
' chat:write, im:write, channels:history, groups:history,',
|
' • im:write, im:history',
|
||||||
' im:history, channels:read, groups:read, users:read,',
|
' • channels:read, channels:history',
|
||||||
' reactions:write',
|
' • groups:read, groups:history',
|
||||||
|
' • chat:write',
|
||||||
|
' • users:read',
|
||||||
|
' • reactions:write',
|
||||||
' 3. App Home → enable "Messages Tab" and "Allow users to send',
|
' 3. App Home → enable "Messages Tab" and "Allow users to send',
|
||||||
' slash commands and messages from the messages tab"',
|
' slash commands and messages from the messages tab"',
|
||||||
' 4. Basic Information → copy the "Signing Secret"',
|
' 4. Basic Information → copy the "Signing Secret"',
|
||||||
' 5. Install to Workspace → copy the "Bot User OAuth Token" (xoxb-…)',
|
' 5. Install to Workspace → copy the "Bot User OAuth Token" (xoxb-…)',
|
||||||
formatNoteLink(SLACK_APPS_URL),
|
].join('\n'),
|
||||||
].filter((line): line is string => line !== null).join('\n'),
|
|
||||||
'Create a Slack app',
|
'Create a Slack app',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user