summaryrefslogtreecommitdiff
path: root/index.py
diff options
context:
space:
mode:
authormrdog233o5 <mr.dog233o5@gmail.com>2023-09-02 12:36:54 +0800
committermrdog233o5 <mr.dog233o5@gmail.com>2023-09-02 12:36:54 +0800
commit1ead48b3f0253ead67d710e4b89c68dbf2275cf6 (patch)
tree0bb7ff595787a6550e157b563fa3aa0906d9dd39 /index.py
parent3e1f9d9a59bcd3a0548508e44d217580eda1aacf (diff)
fuck
Diffstat (limited to 'index.py')
-rw-r--r--index.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/index.py b/index.py
index 4bb0866..ca48c80 100644
--- a/index.py
+++ b/index.py
@@ -11,7 +11,7 @@ channel_id = '1140989222556274721'
url = f'https://discord.com/api/v9/channels/{channel_id}/messages'
# Set the headers with the bot token for authentication
-headers = {'Authorization': f'Bot {token}'}
+header = {'Authorization': f'Bot {token}'}
old_message = ""
@@ -24,10 +24,13 @@ def handle_post_request():
payload = {
'content': message
}
+ files = {
+ "file" : message # The picture that we want to send in binary
+ }
# Send the message to the Discord channel
print(message)
- response = requests.post(url, headers=headers, data=payload, files=message)
+ response = requests.post(url, headers=header, data=payload, files=files)
if response.status_code == 200:
old_message = message
return 'Message sent to Discord channel successfully.'