Last active
July 10, 2019 06:50
-
-
Save lau-jay/7f7de579f4b87438ef3e2c8ae8ad181d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NotifierOP(Notifier): | |
def __init__(self): | |
pass | |
def send_message(self, message): | |
self.post_process(message) | |
def post_process(self, message): | |
""" | |
Process error. | |
""" | |
access_token = "" | |
send_url = DingTalk_API.format(token=access_token) | |
title = "New alert from wallet team" | |
data = { | |
"msgtype": "markdown", | |
"markdown": { | |
"title": title, | |
"text": f"#### {title} \n > {message} [href]({url})" | |
} | |
} | |
requests.post( | |
url=send_url, | |
headers={"Content-Type": "application/json"}, | |
data=json.dumps(data).encode("utf-8")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment