# WXWorkRobot **Repository Path**: Gavin_bx/wxwork-robot ## Basic Information - **Project Name**: WXWorkRobot - **Description**: 企业微信机器人API,调用接口发送到企业微信机器人 - **Primary Language**: Python - **License**: AGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2023-08-24 - **Last Updated**: 2024-04-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: 自写, Python ## README # WXWorkRobot #### 介绍 企业微信机器人API,调用接口发送到企业微信机器人 #### 软件架构 软件架构说明 #### 安装教程 1. xxxx 2. xxxx 3. xxxx #### 使用说明 1. 下载后放入本地site-package文件夹 2. 导入 ```import wxwork_robot as wx``` 3. 实例化 ```wx_robot = wx.WXWorkRobot('your_robot_webhook')``` 4. 也可以使用直接将代码中的测试机器人更换为自己的机器人地址,这样实例化即可直接变为```wx_robot = wx.WXWorkRobot()``` ```python class WXWorkRobot(): def __init__(self,robot_url:str=None) -> None: if robot_url is None: # 测试机器人 self.robot_url = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxxxx' ``` 5. 返回值:```error_code```,```0```表示无异常,详情请参考[企业微信报错代码](https://developer.work.weixin.qq.com/document/path/90313) #### 调用 * 数据格式参考:[企业微信机器人设定](https://developer.work.weixin.qq.com/document/path/91770) * 文本信息(默认MarkDown格式): ```wx_robot.sendMessage('test str')``` * 图片: ```wx_robot.sendImage(image_path)``` * 文件: ```wx_robot.sendFile(file_path)``` * 音频(AMR格式): ```wx_robot.sendVoice(amr_path)``` * 图文: ```wx_robot.sendNews(wx.WX_ARTICLE_STRUCT.getStruct)``` ~* 文本卡片(开发中):```wx_robot.sendTextNotice()```~ ~* 图文卡片(开发中):```wx_robot.sendNewsNotice()```~ #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)