This commit is contained in:
2020-04-25 23:23:50 +08:00
parent 76a8c7dc2e
commit 109c85379b
3 changed files with 13 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "dingtalk"
version = "1.3.0"
version = "1.3.1"
authors = ["Hatter Jiang <jht5945@gmail.com>"]
edition = "2018"
description = "DingTalk Robot Util, Send text/markdown/link messages using DingTalk robot, 钉钉机器人"

View File

@@ -109,6 +109,8 @@ WeChat Work config:
#### Changelog
* v1.3.1
* Add `DingTalk::new_wechat`
* v1.3.0
* Suports WeChat Work now, add type `"type": "wechat"`, supports method `DingTalk::send_text`
* v1.2.1

View File

@@ -267,6 +267,16 @@ impl <'a> DingTalk<'a> {
}
}
/// Create `DingTalk` for WeChat Work
pub fn new_wechat(key: &'a str) -> Self {
DingTalk {
default_webhook_url: DEFAULT_WECHAT_WORK_ROBOT_URL,
dingtalk_type: DingTalkType::WeChatWork,
access_token: key,
..Default::default()
}
}
/// Set default webhook url
pub fn set_default_webhook_url(&mut self, default_webhook_url: &'a str) {
self.default_webhook_url = default_webhook_url;