Skip to content

Commit

Permalink
Standardize - pylinted line_notify.py and rated at 10.00
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyGroupHub committed Jan 23, 2023
1 parent e04ede1 commit 24940f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions line_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def send_message(message):
headers = {"Authorization": "Bearer " + token}
data = {'message': message}
requests.post("https://notify-api.line.me/api/notify",
headers=headers, data=data)
headers=headers, data=data, timeout=5)


def send_image_message(message, image_path):
Expand All @@ -28,7 +28,7 @@ def send_image_message(message, image_path):
token = config.get('line_notify_token')
headers = {"Authorization": "Bearer " + token}
data = {'message': message}
image = open(image_path, 'rb')
files = {'imageFile': image}
with open(image_path, 'rb') as image:
files = {'imageFile': image}
requests.post("https://notify-api.line.me/api/notify",
headers=headers, data=data, files=files)
headers=headers, data=data, files=files, timeout=5)

0 comments on commit 24940f1

Please sign in to comment.