跳转到内容

创建 Slack 应用

Slack 应用就是 Kura酱 使用的机器人身份。要一次性配好所需的作用域、事件和全部 8 个斜杠命令,最快的方式是从清单(manifest)创建 —— 只需粘贴一段配置。

  1. 打开应用列表

    前往 api.slack.com/apps,点击 Create New App

  2. 选择 “From a manifest”

    选中你想让 Kura酱 常驻的工作区,点击 Next

  3. 粘贴清单

    切换到 YAML 标签页,把内容替换为下面这段,然后点击 NextCreatenamedisplay_name 可以改成任何你喜欢的名字。

    display_information:
    name: Kura酱
    description: Slack 里属于你的个人 AI 智能体
    background_color: "#000000"
    features:
    app_home:
    home_tab_enabled: true
    messages_tab_enabled: false
    messages_tab_read_only_enabled: false
    bot_user:
    display_name: Kura酱
    always_online: true
    shortcuts:
    - name: Capture to Kura
    type: message
    callback_id: kura_capture
    description: 把这条消息保存给 Kura酱
    slash_commands:
    - command: /kura-ask
    description: Quick question
    should_escape: false
    - command: /kura-search
    description: Search knowledge base
    should_escape: false
    - command: /kura-summary
    description: Channel summary
    should_escape: false
    - command: /kura-digest
    description: Daily digest
    should_escape: false
    - command: /kura-remind
    description: Set reminder
    should_escape: false
    - command: /kura-files
    description: Recent files
    should_escape: false
    - command: /kura-model
    description: Switch model
    should_escape: false
    - command: /kura-help
    description: Show help
    should_escape: false
    oauth_config:
    scopes:
    bot:
    - app_mentions:read
    - channels:history
    - chat:write
    - commands
    - files:read
    - files:write
    - groups:history
    - im:history
    - im:read
    - im:write
    - im:write.topic
    - mpim:history
    - mpim:read
    - mpim:write
    - reactions:read
    - reactions:write
    - users:read
    pkce_enabled: true
    settings:
    event_subscriptions:
    bot_events:
    - app_home_opened
    - app_mention
    - message.channels
    - message.groups
    - message.im
    interactivity:
    is_enabled: true
    org_deploy_enabled: false
    socket_mode_enabled: true
    token_rotation_enabled: false
    is_mcp_enabled: false
  • Socket Mode —— 外向连接,无需公网 URL。
  • Bot 作用域 —— 发消息(chat:write)、斜杠命令(commands)、读取与上传文件(files:readfiles:write)、读取私信 / 群组私信 / 频道的消息(im:*mpim:*groups:historychannels:history)、发起与命名私信(im:writeim:write.topic)、提及(app_mentions:read)、表情回应(reactions:readreactions:write)、以及识别发言者(users:read)。
  • 事件 —— app_mention、私信 / 群组 / 频道消息(message.immessage.groupsmessage.channels)、app_home_opened
  • InteractivityApp Home 标签,以及一个 “Capture to Kura” 消息快捷方式(右键任意消息 → 保存给 Kura酱)。
  • 全部 8 个 /kura-* 斜杠命令

接着,生成并复制你的凭据:前往两个令牌

手动配置清单(不用 manifest)

Create New App → From scratch 之后,逐节配置:

  1. Socket Mode(Settings → Socket Mode):打开 Enable Socket Mode
  2. OAuth & PermissionsBot Token Scopes,全部添加: app_mentions:readchannels:historychat:writecommandsfiles:readfiles:writegroups:historyim:historyim:readim:writeim:write.topicmpim:historympim:readmpim:writereactions:readreactions:writeusers:read
  3. Event Subscriptions:启用事件,然后在 Subscribe to bot events 添加: app_home_openedapp_mentionmessage.channelsmessage.groupsmessage.im
  4. Interactivity & Shortcuts:打开 Interactivity,然后 Create New ShortcutOn messages,创建名为 Capture to Kura、callback ID 为 kura_capture 的快捷方式。
  5. App Home:启用 Home Tab(Messages 标签可保持关闭)。
  6. Slash Commands:逐个手动创建 8 个命令 —— /kura-ask/kura-search/kura-summary/kura-digest/kura-remind/kura-files/kura-model/kura-help。 开启 Socket Mode 后,Request URL 留空即可。