mirror of
https://github.com/labring/FastGPT.git
synced 2026-05-05 01:02:59 +08:00
4b24472106
* docs(i18n): translate batch 1 * docs(i18n): translate batch 2 * docs(i18n): translate batch 3 (20 files) - openapi/: app, share - faq/: all 8 files - use-cases/: index, external-integration (5 files), app-cases (4 files) Translated using North American style with natural, concise language. Preserved MDX syntax, code blocks, images, and component imports. * docs(i18n): translate protocol docs * docs(i18n): translate introduction docs (part 1) * docs(i18n): translate use-cases docs * docs(i18n): translate introduction docs (part 2 - batch 1) * docs(i18n): translate final 9 files * fix(i18n): fix YAML and MDX syntax errors in translated files - Add quotes to description with colon in submit_application_template.en.mdx - Remove duplicate Chinese content in translate-subtitle-using-gpt.en.mdx - Fix unclosed details tag issue * docs(i18n): translate all meta.json navigation files * fix(i18n): translate Chinese separators in meta.en.json files * translate * translate * i18n --------- Co-authored-by: archer <archer@archerdeMac-mini.local> Co-authored-by: archer <545436317@qq.com>
104 lines
4.4 KiB
Plaintext
104 lines
4.4 KiB
Plaintext
---
|
|
title: Lark Bot Integration
|
|
description: FastGPT Lark Bot Integration Tutorial
|
|
---
|
|
|
|
Starting from version 4.8.10, FastGPT commercial edition supports direct Lark bot integration without additional APIs.
|
|
|
|
## 1. Create a Lark App
|
|
|
|
Creating a free test enterprise makes debugging easier.
|
|
|
|
1. Create a custom enterprise app in the [Lark Open Platform](https://open.feishu.cn/app) developer console.
|
|
|
|

|
|
|
|
Add a **Bot** capability to the app.
|
|
|
|
## 2. Create a Publishing Channel in FastGPT
|
|
|
|
In FastGPT, select the app you want to integrate. On the Publishing Channels page, create a new Lark bot publishing channel and fill in the basic information.
|
|
|
|

|
|
|
|
## 3. Get App ID and App Secret
|
|
|
|
In the Lark Open Platform developer console, find the App ID and App Secret for the custom enterprise app you just created, and enter them in the FastGPT publishing channel dialog.
|
|
|
|

|
|
|
|
Enter both parameters in the FastGPT configuration dialog.
|
|
|
|

|
|
|
|
(Optional) In the Lark Open Platform developer console, go to Events & Callbacks -> Encryption Strategy to get the Encrypt Key, and enter it in the Lark bot integration dialog.
|
|
|
|

|
|
|
|
The Encrypt Key encrypts communication between Lark servers and FastGPT.
|
|
If using HTTPS, the Encrypt Key is not needed. If using HTTP, the Encrypt Key is recommended.
|
|
The Verification Token is generated by default for source verification. However, we use Lark's officially recommended, more secure verification method, so this configuration can be ignored.
|
|
|
|
## 4. Configure Callback URL
|
|
|
|
After creating the publishing channel, click **Request URL** and copy the corresponding request URL.
|
|
|
|
In the Lark console, click `Events & Callbacks` on the left sidebar, click the edit icon next to `Configure Subscription Method`, and paste the copied request URL into the input field.
|
|
|
|
| | | |
|
|
| --- | --- | --- |
|
|
|  |  |  |
|
|
|
|
## 5. Configure Bot Callback Events and Permissions
|
|
|
|
* Add the `Receive Message` event
|
|
|
|
On the `Events & Callbacks` page, click `Add Event`.
|
|
|
|
Search for `Receive Message`, or directly search for `im.message.receive_v1`, find the `Receive Message v2.0` event, check it, and click `Confirm Add`.
|
|
|
|
After adding the event, add two permissions: click the corresponding permission, and a popup will prompt you to add permissions. Add the two permissions shown above.
|
|
|
|
| | |
|
|
| --- | --- |
|
|
|  |  |
|
|
|
|
It is not recommended to enable the two "legacy versions" shown above -- use the new version permissions instead.
|
|
- If "Read messages users send to the bot in private chats" is enabled, private messages sent to the bot will be forwarded to FastGPT
|
|
- If "Receive @bot message events in group chats" is enabled, messages @mentioning the bot in group chats will be forwarded to FastGPT
|
|
- If (not recommended) "Get all messages in groups" is enabled, all group chat messages will be forwarded to FastGPT
|
|
|
|
## 6. Configure Reply Message Permission
|
|
|
|
In the Lark console, click `Permission Management` on the left sidebar, enter `send message` in the search box, find the `Send messages as the app` permission, and enable it.
|
|
|
|

|
|
|
|
## 7. Publish the Bot
|
|
|
|
Click `Version Management & Publishing` on the left side of the Lark console to publish the bot.
|
|
|
|

|
|
|
|
You can then find your bot in the workspace. Next, add the bot to a group or chat with it privately.
|
|
|
|

|
|
|
|
## FAQ
|
|
|
|
### Sent a message but no response
|
|
|
|
1. Check if the Lark bot callback URL, permissions, etc. are configured correctly.
|
|
2. Check FastGPT chat logs to see if there is a corresponding question record.
|
|
3. If there is a record but Lark does not respond, the bot is missing the required permissions.
|
|
4. If there is no record, the app may have encountered an error. Try the simplest bot first. (Lark bots cannot accept global variables, files, or image content as input)
|
|
|
|
### How to start a new chat history
|
|
|
|
Lark bot chat history chatId comes from several sources:
|
|
1. Private chat window
|
|
2. Individual topics in Lark topic groups
|
|
3. In group chats, composed of group ID + personal ID.
|
|
|
|
To reset your chat history, send a `Reset` message to the bot (case-sensitive), and the bot will start a new chat history.
|