Connect a WeChat Work AI bot
Attach an employee as a WeChat Work (WeCom) AI bot and you can message the employee in WeCom. One bot serves one employee. It takes about 20 minutes.
It talks only with WeCom users. It cannot talk directly with individual users of the regular WeChat app.
Before you start
- A WeCom company account and admin rights. The admin console is work.weixin.qq.com
- The admin console is in Chinese or English
- You must be a manager of that employee
The admin console menu names have not yet been re-checked on the real screen. If the screen differs, follow the official WeCom documents at the bottom.
1. Create the AI bot (do not save yet)
- Sign in to the WeCom admin console as an admin and create a new AI bot (智能机器人, "smart robot")
- Choose API mode for the connection type and URL callback for the receiving method. Do not use the "long connection" method
- On that screen, fill in the Token and EncodingAESKey with "random generate" and copy both values
- Do not save yet. Saving needs the receiving address first, and that address comes from step 2
2. Connect in DAIOps and get the callback URL
- In the left sidebar under Employees, pick the employee, then open the Settings tab at the top → the Integrations chip (the Settings item in the sidebar is your account settings, not this). Under "Channels", click Connect on the WeChat Work row. Its detail screen opens, with "Integrations › (name)" at the top
- Enter the two values from step 1 in the Token and EncodingAESKey fields and click Connect. Bot ID (optional) can stay empty
- The detail screen shows the Callback URL with a copy button
3. Enter the callback URL in WeCom and save
- Go back to the screen from step 1, enter the detail screen's Callback URL in the URL field, and save. WeCom checks the address when you save
- Add the bot for the people and group chats that will use it. In a group chat, the bot replies when you @mention it
You are done when: you message the bot in WeCom, a notice appears, and the employee's reply fills in at that spot. The DAIOps detail screen shows "WeChat Work AI bot connected", and the yellow notice "Enter the callback URL below in the WeCom AI bot settings and save" is gone.
4. Set what the employee does on this connection
Under What the employee does on this connection at the bottom of the detail screen, choose the scope. Start with Chat and lookups only.
Common problems
| Symptom | What to do |
|---|---|
| The address check fails when saving | Check that the Token and EncodingAESKey are the same in DAIOps and WeCom. If they differ, use Reconnect in DAIOps to enter the same values |
| The Token is up to 32 letters and digits | Check that the value isn't cut off at either end |
| The EncodingAESKey is 43 letters and digits | Check that the value isn't cut off at either end |
| The reply takes more than 6 minutes | It arrives as a separate message in the same chat |
References
Other messengers
Connecting a Telegram bot · Connecting a LINE Official Account · Connecting a WhatsApp number · Connecting a KakaoTalk channel chatbot