Skip to content

Instantly share code, notes, and snippets.

@Core-commits
Last active June 19, 2020 18:19
Show Gist options
  • Save Core-commits/afa554a22b4744f03fdd5259432026fb to your computer and use it in GitHub Desktop.
Save Core-commits/afa554a22b4744f03fdd5259432026fb to your computer and use it in GitHub Desktop.
import requests #dependency
import json
def ASK():
url = input("Webhook URL: ")
data = {}
data["content"] = input("Contents: ")
data["username"] = input("Username: ")
data["embeds"] = []
embed = {}
embed["title"] = input("Title: ")
embed["description"] = input("Embed message: ")
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("Payload delivered successfully, code {}.".format(result.status_code))
while True:
ASK()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment