Skip to content

Commit

Permalink
doc: 完善使用文档
Browse files Browse the repository at this point in the history
  • Loading branch information
devin committed Aug 26, 2021
1 parent 8aaf46c commit f054c49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

.. code:: python
from dingtalkchatbot.chatbot import DingtalkChatbot
from dingtalkchatbot.chatbot import DingtalkChatbot, ActionCard, CardItem
# WebHook地址
webhook = 'https://oapi.dingtalk.com/robot/send?access_token=这里填写自己钉钉群自定义机器人的token'
secret = 'SEC11b9...这里填写自己的加密设置密钥' # 可选:创建机器人勾选“加签”选项时使用
Expand Down Expand Up @@ -111,7 +111,7 @@
.. code:: python
# Markdown消息@指定用户
xiaoding.send_markdown(title='氧气文字', text='#### 广州天气 @18825166128\n'
xiaoding.send_markdown(title='氧气文字', text='#### 广州天气 @1882516xxxx\n'
'> 9度,西北风1级,空气良89,相对温度73%\n\n'
'> ![美景](http://www.sinaimg.cn/dy/slidenews/5_img/2013_28/453_28488_469248.jpg)\n'
'> ###### 10点20分发布 [天气](http://www.thinkpage.cn/) \n',
Expand Down
4 changes: 2 additions & 2 deletions dingtalkchatbot/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ def update_webhook(self):

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

def msg_open_type(self, url):
"""
Expand Down

0 comments on commit f054c49

Please sign in to comment.