A simple way to avoid hard-coding your webhooks or risking a deletion.
Request Feature or report a bug
This is a very simple script written in python that you can host anywhere, it has a very simple purpose which is ratelimitting and protecting your discord webhook from being deleted, this script will also be compatible with any other webhook integration if you make some small tweaks to it. It is implemented in a very basic way using Flask.
To understand how to use this read Getting Started
The easiest way to install this for free is on Render (Lifetime free hosting).
If you want to install it on your own server you can simply download the files. Dont forget to edit main.py to setup your webhook and key or to hook it up to a .env file!
- Setup a Render account.
- Fork this repository.
- Go to the Dashboard and click connect github.

- Write
python main.pyas your start up command. Select Free as the instance type.
- Click Enviroment and setup the environment variables like this:

DISCORD_WEBHOOK_URL : Write your webhook here.
SECRET_KEY : Write your key here, this is the key you will use to send requests to your render API. It can be whatever you want.
- Press "Deploy Web Service"
- After your service is deployed grab it's URL on the dashboard, it should look something like:
https://webhook-protectorbzx4y.onrender.com
- Now we need to keep our Render server alive 24/7, to do this make an account on CronJob
- After creating your account, go to the Dashboard and click Create CronJob.

- Type whatever you want for the title and set your Render URL as the CrobJob URL.
- Set the execution schedule to every 5 minutes.
- Go into the Advanced tab and set a header with the key
Authorizationand valueKeepAlive, finally change your request method toPOST.
- Done! Your webhook is now protected. The cronjob will keep the render server alive 24/7.
There are 2 example scripts on this repository that show you how to POST to your API and the main.py code is very well commented.
If you have any questions feel free to open an issue or contact me!
This script is inside SendJsonAndFiles.py
import requests
url = "render URL" # URL TO YOUR RENDER
payload = {
"payload_json": '{"username": "test", "content": "hello"}' # your JSON payload, like an embed or a message, this is obviously optional if u just want to send a file
}
# Files to send
with open(r"PATH TO FILE ") as file: # here we use r"" to prevent python from fucking up the string
files = {"file1": file}
# header with ur key
headers = {"Authorization": "yourkey",}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)This script is inside SendJson.py
import requests
url = "your URL" # URL TO YOUR RENDER
payload = {"username": "test", "content": "hello"} # your JSON payload
# header with ur key
headers = {"Authorization": "yourkey",}
response = requests.post(url, json=payload, headers=headers)
print(response.text)- Possibly make a web-ui for this and an account system.
- Feel free to give any suggestions!