How to Deploy OpenClaw AI Assistant on Huawei Cloud and Auto‑Push Hot News to Feishu
This step‑by‑step guide shows developers how to create a Huawei Cloud development environment, obtain MaaS model tokens, install and configure the OpenClaw AI assistant, integrate it with Feishu via a plugin, set permissions and event callbacks, and finally enable automatic hot‑news push using Python code.
Overview
OpenClaw is an AI assistant that runs on a personal computer or server and can interact through chat applications such as Feishu, Telegram, or WhatsApp. It can read, write files, execute commands, and act as a "digital housekeeper" on the local machine.
Case Introduction
This case guides developers to quickly launch OpenClaw in the Huawei Developer Space cloud development environment, connect it to Feishu, and implement a hot‑news proactive push feature.
Target Audience
Enterprise developers
Individual developers
University students
Estimated Duration
Approximately 60 minutes.
Part 1 – Create Cloud Development Environment
Log in to Huawei Developer Space, navigate to Development Platform > Cloud Development Environment > Development Desktop , and create a development desktop.
After creation, start the desktop and open the remote desktop connection.
Part 2 – Obtain MaaS Model Tokens
Two methods are provided to acquire DeepSeek V3.2 model tokens:
Follow the "Huawei Developer Space – ModelArts Studio Token" case to claim a token, which provides the model API address, name, and API key.
Use the "Huawei Cloud MaaS Platform Token" case to purchase a DeepSeek V3 series token package and obtain the same credentials.
Record the API Key, API address, and model name for later steps.
Part 3 – Install OpenClaw and Connect to Feishu
In the cloud development desktop terminal, install the Feishu plugin: openclaw plugins install @m1heng-clawd/feishu Open the Feishu Open Platform (https://open.feishu.cn/app) and create a self‑built enterprise application. Fill in the app name and description.
After creation, add a robot to the app.
Configure permissions by importing the following JSON scopes:
{
"scopes": {
"tenant": [
"contact:contact.base:readonly",
"contact:user.base:readonly",
"im:message",
"im:message.group_at_msg:readonly",
"im:message.p2p_msg:readonly",
"im:message:send_as_bot",
"im:resource"
],
"user": []
}
}Publish a version (e.g., 1.0.0) and save.
Copy the App ID and App Secret from the "Credentials & Basic Info" section.
Configure the OpenClaw client with these credentials:
openclaw config set channels.feishu.appId "your_appId"
openclaw config set channels.feishu.appSecret "your_appSecret"
openclaw gateway restartInstall the official Feishu Python SDK in the CodeArts IDE terminal: pip install lark-oapi -U Replace the generated main.py with the following Python code (using the SDK) to handle message events and maintain a long‑connection:
import lark_oapi as lark
def do_p2_im_message_receive_v1(data: lark.im.v1.P2ImMessageReceiveV1) -> None:
print(f'[ do_p2_im_message_receive_v1 access ], data: {lark.JSON.marshal(data, indent=4)}')
def do_message_event(data: lark.CustomizedEvent) -> None:
print(f'[ do_customized_event access ], type: message, data: {lark.JSON.marshal(data, indent=4)}')
event_handler = lark.EventDispatcherHandler.builder("", "") \
.register_p2_im_message_receive_v1(do_p2_im_message_receive_v1) \
.register_p1_customized_event("out_approval", do_message_event) \
.build()
def main():
cli = lark.ws.Client("YOUR_APP_ID", "YOUR_APP_SECRET", event_handler=event_handler, log_level=lark.LogLevel.DEBUG)
cli.start()
if __name__ == "__main__":
main()After running the script, establish a long‑connection; the service must stay running to receive events.
Part 4 – Enable Hot‑News Push
In the Feishu developer assistant chat, open the published application and send a command such as:
@OpenClaw 去访问以下两个网站(https://www.leikeji.com/)、(https://tech.gmw.cn),如果有任何关于“科技”领域的新闻,立刻把最新的摘要推送给我。The robot will reply with the latest news summary. You can also configure periodic updates or store news locally via additional commands.
Cleanup
When the assistant is no longer needed, stop the OpenClaw gateway to avoid token consumption:
openclaw gateway stopFeedback
If you encounter issues or have improvement suggestions, post them in the Huawei Developer Space forum for assistance.
Huawei Cloud Developer Alliance
The Huawei Cloud Developer Alliance creates a tech sharing platform for developers and partners, gathering Huawei Cloud product knowledge, event updates, expert talks, and more. Together we continuously innovate to build the cloud foundation of an intelligent world.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
