we don't need headers for sending webhooks

master
BuildTools 3 years ago
parent 135a6f02cd
commit 00a2734153
  1. 1
      client.py

@ -59,7 +59,6 @@ class client():
headers = {"Authorization": "Bot {0}".format(self.config["token"]), "User-Agent": "mbdf (cynic.moe, v1)", "Content-Type": "application/json"} headers = {"Authorization": "Bot {0}".format(self.config["token"]), "User-Agent": "mbdf (cynic.moe, v1)", "Content-Type": "application/json"}
return requests.get(endpoint, headers = headers).text return requests.get(endpoint, headers = headers).text
def execute_webhook(self, link, message, name = "webhook"): def execute_webhook(self, link, message, name = "webhook"):
headers = {"Authorization": "Bot {0}".format(self.config["token"]), "User-Agent": "mbdf (cynic.moe, v1)", "Content-Type": "application/json"}
requests.post(link, headers = headers, data = json.dumps({"content": message, "username": name})) requests.post(link, headers = headers, data = json.dumps({"content": message, "username": name}))
def send_msg(self, id, message): def send_msg(self, id, message):
endpoint = f"https://discordapp.com/api/channels/{id}/messages" endpoint = f"https://discordapp.com/api/channels/{id}/messages"

Loading…
Cancel
Save