Spaces:
Sleeping
Sleeping
from flask import Flask, request, jsonify | |
import os | |
app = Flask(__name__) | |
def interactions(): | |
data = request.json | |
# Discord Ping Verification | |
if data["type"] == 1: | |
return jsonify({"type": 1}) | |
# Slash Command Handler | |
if data["type"] == 2: | |
command = data["data"]["name"] | |
if command == "settings": | |
return jsonify({ | |
"type": 4, | |
"data": { | |
"content": "Hier sind die aktuellen Einstellungen deiner App." | |
} | |
}) | |
return jsonify({}) | |
if __name__ == "__main__": | |
app.run(host="0.0.0.0", port=int(os.getenv("PORT", 8080))) |