Skip to content

Instantly share code, notes, and snippets.

@peco2282
Created August 29, 2022 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peco2282/f255afc4c1dae015cb5aac05bf1cefce to your computer and use it in GitHub Desktop.
Save peco2282/f255afc4c1dae015cb5aac05bf1cefce to your computer and use it in GitHub Desktop.
import requests
payload = [
{
"name": "payload_json",
"value": {
"content": "this is a PNG file.",
"attachments": [
{
"id": 0,
"filename": "example.png"
}
]
}
}, {
"name": "files[0]",
"value": "C:\\Users\\peco2282\\Desktop\\example.png",
"filename": "example.png",
"content_type": "application/octet-stream"
}
]
if __name__ == '__main__':
r = requests.post(
"https://discord.com/api/webhooks/1013710735051857962/ThisIsWebhookToken",
json=payload
)
print(r.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment