Last active
September 23, 2018 10:50
-
-
Save amaotone/2eea52379d559a4dc60e6c6c76085b7b to your computer and use it in GitHub Desktop.
LINEに通知を送るやつ。API tokenの発行は https://notify-bot.line.me/my/ から。
This file contains 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
def notify(message): | |
assert type(message) is str | |
token = YOUR_ACCESS_TOKEN # deactivate when the competition is over | |
api = 'https://notify-api.line.me/api/notify' | |
message = "\n" + message | |
payload = {'message': message} | |
headers = {'Authorization': 'Bearer {}'.format(token)} | |
requests.post(api, data=payload, headers=headers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment