diff options
| author | mrdog233o5 <mr.dog233o5@gmail.com> | 2023-09-02 12:36:54 +0800 |
|---|---|---|
| committer | mrdog233o5 <mr.dog233o5@gmail.com> | 2023-09-02 12:36:54 +0800 |
| commit | 1ead48b3f0253ead67d710e4b89c68dbf2275cf6 (patch) | |
| tree | 0bb7ff595787a6550e157b563fa3aa0906d9dd39 /index.py | |
| parent | 3e1f9d9a59bcd3a0548508e44d217580eda1aacf (diff) | |
fuck
Diffstat (limited to 'index.py')
| -rw-r--r-- | index.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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.' |
