Skip to content

Commit f054c49

Browse files
author
devin
committed
doc: 完善使用文档
1 parent 8aaf46c commit f054c49

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060

6161
.. code:: python
6262
63-
from dingtalkchatbot.chatbot import DingtalkChatbot
63+
from dingtalkchatbot.chatbot import DingtalkChatbot, ActionCard, CardItem
6464
# WebHook地址
6565
webhook = 'https://oapi.dingtalk.com/robot/send?access_token=这里填写自己钉钉群自定义机器人的token'
6666
secret = 'SEC11b9...这里填写自己的加密设置密钥' # 可选:创建机器人勾选“加签”选项时使用
@@ -111,7 +111,7 @@
111111
.. code:: python
112112
113113
# Markdown消息@指定用户
114-
xiaoding.send_markdown(title='氧气文字', text='#### 广州天气 @18825166128\n'
114+
xiaoding.send_markdown(title='氧气文字', text='#### 广州天气 @1882516xxxx\n'
115115
'> 9度,西北风1级,空气良89,相对温度73%\n\n'
116116
'> ![美景](http://www.sinaimg.cn/dy/slidenews/5_img/2013_28/453_28488_469248.jpg)\n'
117117
'> ###### 10点20分发布 [天气](http://www.thinkpage.cn/) \n',

dingtalkchatbot/chatbot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ def update_webhook(self):
9090

9191
sign = quote_plus(base64.b64encode(hmac_code))
9292
if 'timestamp'in self.webhook:
93-
self.webhook = '{}&timestamp={}&sign={}'.format(self.webhook[:self.webhook.find('&timestamp')], str(timestamp), sign)
93+
self.webhook = '{}&timestamp={}&sign={}'.format(self.webhook[:self.webhook.find('&timestamp')], str(timestamp), sign) # 更新时间戳
9494
else:
95-
self.webhook = '{}&timestamp={}&sign={}'.format(self.webhook, str(timestamp), sign)
95+
self.webhook = '{}&timestamp={}&sign={}'.format(self.webhook, str(timestamp), sign) # 首次初始化
9696

9797
def msg_open_type(self, url):
9898
"""

0 commit comments

Comments
 (0)