Spaces:
Sleeping
Sleeping
Update app/app.py
Browse files- app/app.py +8 -6
app/app.py
CHANGED
@@ -6,13 +6,14 @@ app = Flask(__name__)
|
|
6 |
@app.route("/interactions", methods=["POST"])
|
7 |
def interactions():
|
8 |
data = request.json
|
9 |
-
|
|
|
10 |
if data["type"] == 1:
|
11 |
-
return jsonify({"type": 1})
|
12 |
-
|
13 |
-
|
|
|
14 |
command = data["data"]["name"]
|
15 |
-
|
16 |
if command == "settings":
|
17 |
return jsonify({
|
18 |
"type": 4,
|
@@ -20,7 +21,8 @@ def interactions():
|
|
20 |
"content": "Hier sind die aktuellen Einstellungen deiner App."
|
21 |
}
|
22 |
})
|
|
|
23 |
return jsonify({})
|
24 |
|
25 |
if __name__ == "__main__":
|
26 |
-
app.run(host="0.0.0.0", port=int(os.getenv("PORT", 8080)))
|
|
|
6 |
@app.route("/interactions", methods=["POST"])
|
7 |
def interactions():
|
8 |
data = request.json
|
9 |
+
|
10 |
+
# Discord Ping Verification
|
11 |
if data["type"] == 1:
|
12 |
+
return jsonify({"type": 1})
|
13 |
+
|
14 |
+
# Slash Command Handler
|
15 |
+
if data["type"] == 2:
|
16 |
command = data["data"]["name"]
|
|
|
17 |
if command == "settings":
|
18 |
return jsonify({
|
19 |
"type": 4,
|
|
|
21 |
"content": "Hier sind die aktuellen Einstellungen deiner App."
|
22 |
}
|
23 |
})
|
24 |
+
|
25 |
return jsonify({})
|
26 |
|
27 |
if __name__ == "__main__":
|
28 |
+
app.run(host="0.0.0.0", port=int(os.getenv("PORT", 8080)))
|