File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 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...这里填写自己的加密设置密钥' # 可选:创建机器人勾选“加签”选项时使用
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 ' > \n '
117117 ' > ###### 10点20分发布 [天气](http://www.thinkpage.cn/) \n ' ,
Original file line number Diff line number Diff 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 = '{}×tamp={}&sign={}' .format (self .webhook [:self .webhook .find ('×tamp' )], str (timestamp ), sign )
93+ self .webhook = '{}×tamp={}&sign={}' .format (self .webhook [:self .webhook .find ('×tamp' )], str (timestamp ), sign ) # 更新时间戳
9494 else :
95- self .webhook = '{}×tamp={}&sign={}' .format (self .webhook , str (timestamp ), sign )
95+ self .webhook = '{}×tamp={}&sign={}' .format (self .webhook , str (timestamp ), sign ) # 首次初始化
9696
9797 def msg_open_type (self , url ):
9898 """
You can’t perform that action at this time.
0 commit comments