Skip to content

Instantly share code, notes, and snippets.

@Core-commits
Last active June 19, 2020 12:09
Show Gist options
  • Save Core-commits/fa13bbc607982c167be4c257fb80870c to your computer and use it in GitHub Desktop.
Save Core-commits/fa13bbc607982c167be4c257fb80870c to your computer and use it in GitHub Desktop.
import requests #dependency
import json
url = "Discord webhook url here"
data = {}
data["content"] = input("__ Type here what you want the webhook to say OUT of the embed.\nChoco-Girl$ ")
data["username"] = "Username"
data["embeds"] = []
embed = {}
embed["title"] = input("Title: ")
embed["description"] = input("Text: ")
data["embeds"].append(embed)
result = requests.post(url, data=json.dumps(data), headers={"Content-Type": "application/json"})
try:
result.raise_for_status()
except requests.exceptions.HTTPError as err:
print(err)
else:
print("Post Sent with the code {}.".format(result.status_code))
#result: https://i.imgur.com/DRqXQzA.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment