From da52212552b3985cdb98730c9050159b4b91a947 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 2 Sep 2023 15:47:52 +0800 Subject: test revert --- index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.py b/index.py index 8a118db..2fa7e18 100644 --- a/index.py +++ b/index.py @@ -14,12 +14,12 @@ url = f'https://discord.com/api/v9/channels/{channel_id}/messages' header = {'Authorization': f'Bot {token}'} old_message = "" -isFile = False @app.route('/', methods=['POST']) def handle_post_request(): global old_message message = request.get_data().decode('utf-8') + isFile = False if message.split(maxsplit = 1)[0] == "FILE": isFile = True # Check if the message is different from the previous one @@ -34,7 +34,7 @@ def handle_post_request(): 'content': f"``file opened: {file[0]}``" } files = { - "file" : (file[0],file[1].decode()) # The picture that we want to send in binary + "file" : (file[0],file[1]) # The picture that we want to send in binary } response = requests.post(url, headers=header, data=payload, files=files) else: -- cgit v1.2.3