Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,3 +2,21 @@ from bot import main
|
|
2 |
|
3 |
if __name__ == '__main__':
|
4 |
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
if __name__ == '__main__':
|
4 |
main()
|
5 |
+
from flask import Flask, request, jsonify
|
6 |
+
|
7 |
+
app = Flask(__name__)
|
8 |
+
|
9 |
+
@app.route('/token', methods=['POST'])
|
10 |
+
def distribute_token():
|
11 |
+
data = request.get_json()
|
12 |
+
user_id = data.get('user_id')
|
13 |
+
token_amount = data.get('amount')
|
14 |
+
|
15 |
+
# Mock token distribution logic
|
16 |
+
return jsonify({
|
17 |
+
"status": "success",
|
18 |
+
"message": f"Distributed {token_amount} tokens to user {user_id}"
|
19 |
+
})
|
20 |
+
|
21 |
+
if __name__ == '__main__':
|
22 |
+
app.run(host='0.0.0.0', port=7860)
|