https://github.com/tomtc123/wxrobot
Unity接入企业微信机器人发送消息
https://github.com/tomtc123/wxrobot
csharp unity wxrobot wxwork
Last synced: about 1 month ago
JSON representation
Unity接入企业微信机器人发送消息
- Host: GitHub
- URL: https://github.com/tomtc123/wxrobot
- Owner: tomtc123
- License: apache-2.0
- Created: 2024-06-29T07:35:07.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-18T12:44:39.000Z (about 1 year ago)
- Last Synced: 2025-04-19T01:52:02.214Z (about 1 year ago)
- Topics: csharp, unity, wxrobot, wxwork
- Language: C#
- Homepage:
- Size: 121 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WXRobot
Unity接入企业微信机器人发送消息
## 使用场景
Unity自动打包出错等信息可以自动通知到群机器人
## 示例
### 1.发送文本消息
```csharp
var WebHookUrl = "填入你的机器人地址";
WxRobotHelper.PostText(WebHookUrl, "Hello Robot!", "@all");
```

### 2.发送Markdown消息
```csharp
var sb = new StringBuilder();
sb.AppendLine("颜色文本");
sb.AppendLine("颜色文本");
sb.AppendLine("颜色文本");
sb.AppendLine("企业微信内置颜色");
sb.AppendLine("企业微信内置颜色");
sb.AppendLine("企业微信内置颜色");
WxRobotHelper.PostMarkdown(WebHookUrl, sb.ToString());
```

### 3.发送图片信息
```csharp
var texture = Resources.Load("test.png");
WxRobotHelper.PostImage(WebHookUrl, texture);
```

# 参考
[企业微信开发者中心](https://developer.work.weixin.qq.com/document/path/91770)