Last active
June 19, 2020 18:19
-
-
Save Core-commits/afa554a22b4744f03fdd5259432026fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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