Connect Feishu
Connect a Feishu app bot, and wake it in private chats or with a keyword in groups.
Feishu is ByteDance's workplace messaging app; outside China it's called Lark. Everything below works the same for both. One ShiritaiBot instance can connect to QQ and one Feishu bot at the same time. For how Feishu bots work, see the official bot overview.
ShiritaiBot offers two ways to connect: create a bot by scanning a QR code, or connect an existing app by hand.
Create by scanning a QR code
- In Connections, click Add, choose Feishu app bot, then click Create by scanning a QR code.
- Choose Feishu or Lark, depending on the app you use, and click Generate QR code. Scan it with that phone app and confirm.
- Back in the WebUI, pick a memory store and click Save and connect. The app credentials are saved automatically.
If you already have a Feishu connection, save the new bot as disabled and switch over later.
If the bot was created on your phone but no instance appears in the WebUI, connect that app with Configure manually below.
Connect manually
- Open the app on the Feishu Open Platform or the Lark Open Platform, and copy the App ID and App Secret from Credentials & Basic Info. If you don't have an app yet, create a custom app and add the bot capability.
- In the WebUI's Connections, click Add, choose Feishu app bot, then click Configure manually.
- Choose the platform, enter the App ID and App Secret, turn on Enable connection and save.
If Feishu isn't in the list, update to the main branch and rebuild the WebUI.
Publish and subscribe to events
Apps you created by hand need the settings below. If you created the bot with a QR code and it's still waiting to be published or approved, or doesn't receive messages, check these too.
- In Permissions & Scopes on the open platform, enable
im:message.p2p_msg:readonly(receive private messages) andim:message:send_as_bot(send messages). - In Events & Callbacks, choose to receive events through a persistent connection (long connection) and subscribe to
im.message.receive_v1. If the platform says the connection isn't established, enable the instance in ShiritaiBot first, then come back and save. The long connection guide has the details. - Publish the app and add the accounts that will use the bot to its availability range. If publishing needs approval, wait for an admin to approve it before testing.
Set the owner
Send the bot a text message from the account you want as the owner. In the Feishu instance in the WebUI, find that sender's ou_… ID among the recent senders, enter it in Owner Open ID and save. Send another message and check that the bot replies.
Wake the bot in groups
- On the open platform, request
im:message.group_msg. Once it's approved and the app is published, add the bot to a test group. This permission lets Feishu deliver group messages that don't@the bot. - In the Feishu instance's Allowed group chats, enter the group IDs, one
oc_…per line. The chat list API shows a group's ID. - Save, then send a message in the group that starts with a wake word and check that the bot replies.
To let the bot read recent discussion in the group, turn on Record Feishu group context.
Memory store
Feishu private chats use Separate Feishu memory by default, apart from the memory of QQ and the WebUI. To share memory with QQ and the WebUI, choose Existing default memory in the Feishu instance.