Built with:
- Deno + Oak
- Lark Node.js SDK (with Node.js compatibility in Deno)
- btrdb for persisting chat context
By default, user messages are a reply to the last message in the chat (unless the !new
command is used).
If the user replies to a previous message in the chat history, a new conversation branch will be created starting from the replied message.
!new
(- starts a new conversation!reset
)- Note: You can still resume previous conversations by replying to them.
!system
- manages system prompt setting (for current chat)!system
- shows the current system prompt!system default
- restores the system prompt to default settings!system One line answers by default.
- overrides system prompt to "One line answers by default."
- Create
config.js
(See config.example.js). - Run
deno run -A https://raw.github.com/lideming/lark-ai-bot/master/src/app.ts
- or (for permission control)
deno run --allow-net --allow-read --allow-write=data --allow-env https://raw.github.com/lideming/lark-ai-bot/master/src/app.ts
- or (for permission control)
- Clone this repo
cp config.example.js config.js
and editconfig.js
- Run
run.sh
(Deno 1.28+ is required)
Event and webhooks should be enabled and configured in Lark/Feishu Developer Console.
In Event Subscriptions, set Request URL to <API_HOST>/<APP_PATH>/events
, and enable the im.message.receive_v1
event.
In Features - Bot, set Message Card Request URL to <API_HOST>/<APP_PATH>/interactive-events
.
(<APP_PATH>
is the key of apps
config object.)
Required permissions:
- im:message.group_at_msg
- im:message.p2p_msg
- im:message:send_as_bot
- im:message.groups