Puppet Provider: Lark
- Repo: https://github.com/wechaty/wechaty-puppet-lark
- Support & Feedback: https://github.com/wechaty/wechaty-puppet-lark/issues
Features
- Send & Receive Messages (Text, Image, Video, File)
- Get Contact List
Usage
Run wechaty-puppet-lark
:
- Linux
- macOS
- Windows
npm install wechaty-puppet-lark
export WECHATY_PUPPET=wechaty-puppet-lark
npm start
npm install wechaty-puppet-lark
export WECHATY_PUPPET=wechaty-puppet-lark
npm start
npm install wechaty-puppet-lark
set WECHATY_PUPPET=wechaty-puppet-lark
npm start
Integration
Let's take up an example on how to integrate bot from starter templete to Lark. The step is similar for all other bots as well.
Prerequisite
- Offical Wechaty package: package/wechaty.
- Configure your system environment variables as below:
WECHATY_PUPPET_LARK_APPID
: for the app ID of Feishu application.WECHATY_PUPPET_LARK_APPSECRET
: for the app secret of Feishu App.WECHATY_PUPPET_LARK_TOKEN
: for the verification token provided by Feishu Event Subscription Platform.
You can follow up the steps mentioned below:
Initialize the project by creating a new folder
my-bot
:mkdir my-bot
cd my-botInstall the dependencies using the following commands:
npm install wechaty
Add the dependencies for using the bot with Lark:
npm install wechaty-puppet-lark
Create a new folder
src
and add a filemy-bot.js
. Add any of the functions from add functionality to the bot section to the snippet below:import {
Contact,
Message,
ScanStatus,
Wechaty,
log,
} from 'wechaty'
console.log(welcome)
const bot = new Wechaty()
/*
*Your function goes here
*/Obtain your functional permissions on Feishu platform from Feishu Open Platform-Application Permission.
After you are done with the file, you can run the bot using the following commands:
export WECHATY_LOG=verbose
export WECHATY_PUPPET=wechaty-puppet-lark
node src/my-bot.js
Copy the generated code to Lark and you are ready to play with the bot!
Videos
Presentation
Live Coding
For more information on deploying in Lark, you can refer to this Pull Request
Blog links
- 基于开放 API 封装 Wechaty 接口下的飞书聊天机器人, 范蕊, Sep 30, 2020
- Wechaty Puppet lark plan blog
- Wechaty Puppet Lark mid term blog
- Wechaty Puppet Lark final blog
- OSPP plan Wechaty Puppet Lark