-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
37 lines (34 loc) · 1.52 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from colorama import Fore
import requests as rq
from flask import Flask, request,redirect
import config
app = Flask(__name__)
print(Fore.GREEN, """
-----------------------------------------
__ __ _ _ _ _____
\ \ / / | | | | | | | __ \\
\ \ /\ / /__| |__ | |__ ___ ___ | | _| |__) | __ _____ ___ _
\ \/ \/ / _ \ '_ \| '_ \ / _ \ / _ \| |/ / ___/ '__/ _ \ \/ / | | |
\ /\ / __/ |_) | | | | (_) | (_) | <| | | | | (_) > <| |_| |
\/ \/ \___|_.__/|_| |_|\___/ \___/|_|\_\_| |_| \___/_/\_\\__, |
__/ |
|___/
""")
print(Fore.GREEN, "-----------------------------------------")
@app.route("/", methods=['POST', 'GET']) #heheboi
def home():
return redirect("https://github.com/eletrixtech/Webhook-Proxy")
@app.route("/api/webhooks/<channelid>/<webhook>", methods=['POST', 'GET'])
def api_send(channelid, webhook):
if request.method == 'POST':
data = request.json
if data is None:
return "empty_data", 400
else:
r = rq.post(url=f"https://discord.com/api/webhooks/{channelid}/{webhook}", json=data)
return r.text
elif request.method == 'GET':
r = rq.get(url=f"https://discord.com/api/webhooks/{channelid}/{webhook}")
return r.text
if __name__ == "__main__":
app.run(host="0.0.0.0", port=config.PORT)