Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
tas_token_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9478b20c
authored
May 14, 2024
by
陈森彬
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
切换微信告警机器人
parent
58ef3131
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
utils/robots.py
utils/robots.py
View file @
9478b20c
...
@@ -8,18 +8,20 @@ import requests
...
@@ -8,18 +8,20 @@ import requests
dd_robot_api
=
' https://oapi.dingtalk.com/robot/send?access_token='
dd_robot_api
=
' https://oapi.dingtalk.com/robot/send?access_token='
tom
=
'c19beeab837f5c6e019e7fc602d470704d634ae33510f40fb0e903cde215fb24'
tom
=
'c19beeab837f5c6e019e7fc602d470704d634ae33510f40fb0e903cde215fb24'
msgapi_url
=
'http://api.ichunt.com/msg/sendMessageByAuto'
msgapi_url
=
'http://api.ichunt.com/msg/sendMessageByAuto'
wechat_robot_api
=
"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key="
tom_key
=
"bb2b5b4e-9a06-4d3d-89f5-61bcf07ed4ba"
def
dd_send_msg
(
msg
,
robot
=
tom
):
def
dd_send_msg
(
msg
,
robot
=
tom_key
):
data
=
{
data
=
{
"msgtype"
:
"text"
,
"msgtype"
:
"text"
,
"text"
:
{
"text"
:
{
"content"
:
msg
"content"
:
msg
}
}
}
}
requests
.
post
(
dd
_robot_api
+
robot
,
json
=
data
)
requests
.
post
(
wechat
_robot_api
+
robot
,
json
=
data
)
time
.
sleep
(
5
)
time
.
sleep
(
5
)
if
'digikey'
in
msg
:
if
'digikey'
in
msg
:
content
=
'digikey token同步失败'
content
=
'digikey token同步失败'
cur_time
=
int
(
time
.
time
())
cur_time
=
int
(
time
.
time
())
m
=
hashlib
.
md5
()
m
=
hashlib
.
md5
()
...
@@ -32,5 +34,6 @@ def dd_send_msg(msg, robot=tom):
...
@@ -32,5 +34,6 @@ def dd_send_msg(msg, robot=tom):
'ex_str'
:
''
,
'k2'
:
d
.
hexdigest
(),
'k1'
:
str
(
cur_time
)}
'ex_str'
:
''
,
'k2'
:
d
.
hexdigest
(),
'k1'
:
str
(
cur_time
)}
requests
.
post
(
msgapi_url
,
data
=
data
)
requests
.
post
(
msgapi_url
,
data
=
data
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
dd_send_msg
(
'digikey喂喂 你发的太多了!'
)
dd_send_msg
(
'digikey喂喂 你发的太多了!'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment