summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-09-02 15:41:43 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-09-02 15:41:43 +0800
commite31f2e9047f33e06d86f27c7cc583459da1223ae (patch)
treef64fe681f71fb069ff3ca5a68bf7dd0d4f1869ed
parentf8b6df1ccf4f14d607d95a6f9fa279aefb45b9d4 (diff)
updated
-rw-r--r--index.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/index.py b/index.py
index 2fa7e18..8a118db 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]) # The picture that we want to send in binary
+ "file" : (file[0],file[1].decode()) # The picture that we want to send in binary
}
response = requests.post(url, headers=header, data=payload, files=files)
else: