From d55849fdd558fd776bba281f93d0be9af370cf79 Mon Sep 17 00:00:00 2001 From: ElBe <90863907+ElBe-Plaq@users.noreply.github.com> Date: Wed, 14 Sep 2022 07:19:32 +0200 Subject: [PATCH] Create command_creator.py --- Bot/command_creator.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Bot/command_creator.py diff --git a/Bot/command_creator.py b/Bot/command_creator.py new file mode 100644 index 0000000..581b1fb --- /dev/null +++ b/Bot/command_creator.py @@ -0,0 +1,27 @@ +''' +Slash command creator for the discord.py The Guardians Bot. +© by ElBe. + +Version: 0.1.0 +''' + +#Imports +import requests + +#Variables +url = "https://discord.com/api/v10/applications//commands" +json = { + "name": "", + "type": 1, + "description": "" +} +headers = { + "Authorization": "Bot " +} + +#Request +try: + r = requests.post(url, headers=headers, json=json) + print('Command /' + str(json['name']) + ' was sucessfully created.') +except Exception as e: + print('Error while trying to create the command /' + str(json['name']) + '.\n' + str(e))