From 1ead48b3f0253ead67d710e4b89c68dbf2275cf6 Mon Sep 17 00:00:00 2001 From: mrdog233o5 Date: Sat, 2 Sep 2023 12:36:54 +0800 Subject: fuck --- index.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'index.py') 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.' -- cgit v1.2.3