TradingMate-FeiShu 频道配置

By TradingMateAdmin | 2026年3月17日

Lark Channel Configuration

Lark channels receive messages via WebSocket long connections , requiring no public IP address or webhook; sending messages uses the Lark Open Platform Open API. It supports sending and receiving text, images, and files; in group chat scenarios chat_id, messages are message_idincluded in the request message’s metadata for easier downstream deduplication and group context recognition.

Create a Lark application and obtain credentials

  1. Open Lark Open Platform and create your own enterprise application.
    Feishu
    build
  2. Obtain the App ID and App Secret from “Credentials and Basic Information”.
    id & secret
  3. Enter the App ID and App Secret as described above in the front-end page and save.
  4. Execute the exit and restart the software startup service.
  5. Return to the Lark Open Platform and enable the robot in “Capabilities”.
    bot
  6. Select “Batch Import/Export Permissions” under “Permission Management” and copy the following JSON code into it.
    {
      "scopes": {
        "tenant": [
          "aily:file:read",
          "aily:file:write",
          "aily:message:read",
          "aily:message:write",
          "corehr:file:download",
          "im:chat",
          "im:message",
          "im:message.group_msg",
          "im:message.p2p_msg:readonly",
          "im:message.reactions:read",
          "im:resource",
          "contact:user.base:readonly"
        ],
        "user": []
      }
    }
    in/out
    json
    confirm
    confirm
  7. In “Events and Callbacks”, click “Event Configuration” and select the long-lived connection (WebSocket) mode as the subscription method (no public IP required).

    Note: The operation sequence is as follows: first configure the App ID/Secret on the front end → exit and restart the software → then configure the long connection on the open platform. If an error is still displayed here, try ending the software and restarting it.

    websocket
  8. Select “Add Event,” search for received messages , and subscribe to Message Receiving v2.0.
    reveive
    click
    result
  9. In the “Version Management and Release” section of “Application Release”, create a version , fill in the basic information, save , and release.
    create
    info
    save

Enter App ID and App Secret

Other fields (encrypt_key, verification_token, media_dir) are optional. WebSocket mode can be left blank and has default values.

Note: App ID and App Secret information can be filled in on the front end, but you need to restart the software before you can continue configuring the long link.

console

Robot Permission Suggestions

The JSON file in step 6 configures the application with the following permissions (application identity, enabled) to ensure normal message sending and receiving and file transfer:

Permission Name Permission ID Permission types illustrate
Get File aily:file:read Application Identity
Upload File aily:file:write Application Identity
Get Message aily:message:read Application Identity
Send message aily:message:write Application Identity
Download file corehr:file:download Application Identity
Get and update group information im:chat Application Identity
Get and send one-on-one chat and group messages im:message Application Identity
Retrieve all messages in the group (sensitive permission) im:message.group_msg Application Identity
Read one-on-one chat messages sent by the user to the bot im:message.p2p_msg:readonly Application Identity
View message emoticon replies im:message.reactions:read Application Identity
Obtaining and uploading image or file resources im:resource Application Identity
Read contacts by application identity contact:user.base:readonly Application Identity See below for instructions

Retrieving User Nicknames (Recommended) : To display user nicknames (e.g., “Zhang San#1d1a”) instead of “unknown#1d1a” in conversations and logs, you need to additionally grant read-only access to the contacts list to read the contacts as an applicationcontact:user.base:readonly . Without this permission, Lark only returns identity fields such as open_id, not the name, and CoPAW cannot parse the nickname. After granting permission, you need to republish/update the application version; once the permission takes effect, the user name will be displayed correctly.

Add the robot to favorites

  1. Click ” Add Frequently Used” in the workbench .
    Add frequently used
  2. Search for the name of the robot you just created and add it.
    Add to
  3. You can see that the robot has been added to your favorites list. Double-click to enter the chat interface.
    Added
    Dialogue Interface

Leave a Comment