MokenLogic

Help Doc

WeCom Integration Guide

Use WeCom’s “intelligent bot” API mode to connect a MokenLogic agent to WeCom, so your team can talk to your agent directly in one-on-one or group chats. The whole process takes about 3 minutes.

Before you start

  • A WeCom “super admin” account, or a sub-admin account with “Management Tools” permission.
  • MokenLogic installed and initialized, with at least one agent created.
  • A Mac that stays running to host the persistent connection (no public IP or domain required).

Steps

  1. Open the WeCom “Intelligent Bot” admin page

    Sign in to the WeCom admin console with an admin account, then in the left sidebar go to “Security & Management” → “Management Tools”, and click the “Intelligent Bot” card under the “AI Zone” category on the right.

    Requires a WeCom “super admin” account, or a sub-admin with “Management Tools” permission. · Admin console: https://work.weixin.qq.com/wework_admin/

  2. Choose “Create manually”

    On the “Intelligent Bot” page, click the “Create bot” button. In the “What kind of bot do you need” dialog that appears, choose “Create manually” in the lower-left corner.

    Do not use the “AI auto-generate” option in the dialog — otherwise the configuration fields needed for API mode will not appear later.

  3. Switch to “Create in API mode”

    On the “Create Intelligent Bot” configuration page, scroll the right-hand settings panel to the very bottom, and just above the “Save / Cancel” buttons, click the “Create in API mode” link.

    In API mode, Moken takes over response generation, so page settings like “Plugins,” “Workflows,” and “Welcome message” can be left blank.

  4. Choose the persistent connection and copy the Bot ID and Secret

    In the “API Configuration” area, set “Connection method” to “Use persistent connection” (no domain or public IP needed). Then copy the auto-generated “Bot ID” below, and click “Get” next to “Secret” to generate the key and copy it.

    Store the Secret safely — once you close the page you cannot view it again, only regenerate it. · Remember to set the bot’s “Visible scope” at the top of the page and click “Save,” otherwise members cannot chat with the bot in WeCom.

  5. Add the WeCom bot in MokenLogic

    Open MokenLogic, go to “Capabilities → Integrations,” find the “WeCom” connector, and click “+ Add bot.” In the dialog, paste what you copied in the previous step into “Bot ID” and “Bot Secret,” pick the “Agent” that should respond to messages, optionally give it a recognizable “Display name,” and finally click “Register bot” to finish.

    Once registered, the bot connects to MokenLogic over the persistent connection immediately — send the bot a message in WeCom and the chosen agent will reply. · You can click “Refresh” on the “Integrations” page anytime to check connection status, or click the trash icon to remove the bot.

Done! Next steps

After registration, members within the visible scope can message the bot in WeCom, and the chosen agent handles the replies. To have the bot respond in group chats, open a WeCom group, click “···” in the top-right → “Group bots,” and add the bot to the group.

  • Change the visible scope, responding agent, or display name: go back to MokenLogic’s “Integrations” page to adjust.
  • Secret leaked or lost: regenerate the Secret in the bot’s “API Configuration” area in the WeCom admin console, then update it in MokenLogic.
  • Bot not responding: make sure MokenLogic is running on your Mac and not asleep, and click “Refresh” on the “Integrations” page to check connection status.
All guides