jerrrycans commited on
Commit
8c5cfe0
·
verified ·
1 Parent(s): cbef08f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -13
app.py CHANGED
@@ -3,20 +3,19 @@ import requests
3
 
4
  app = Flask(__name__)
5
 
6
- @app.route('/v1/users/avatar-headshot', methods=['GET'])
7
- def mirror_avatar_api():
8
- size = request.args.get('size', '100x100')
9
- format = request.args.get('format', 'png')
10
- user_ids = request.args.get('userIds')
11
-
12
- if not user_ids:
13
- return jsonify({"error": "userIds parameter is required"}), 400
14
-
15
- roblox_url = f"https://thumbnails.roblox.com/v1/users/avatar-headshot?size={size}&format={format}&userIds={user_ids}"
16
-
17
- response = requests.get(roblox_url)
18
 
19
- return jsonify(response.json()), response.status_code
 
 
 
 
 
 
20
 
21
  if __name__ == '__main__':
22
  app.run(host='0.0.0.0', port=7860)
 
3
 
4
  app = Flask(__name__)
5
 
6
+ @app.route('/webhooks/<path:webhook_id>', methods=['POST'])
7
+ def mirror_discord_webhook(webhook_id):
8
+ payload = request.json
9
+
10
+ discord_url = f"https://discord.com/api/webhooks/{webhook_id}"
 
 
 
 
 
 
 
11
 
12
+ try:
13
+ response = requests.post(discord_url, json=payload)
14
+
15
+ return jsonify(response.json()), response.status_code
16
+ except requests.exceptions.RequestException as e:
17
+ # Handle any errors during the request
18
+ return jsonify({"error": str(e)}), 500
19
 
20
  if __name__ == '__main__':
21
  app.run(host='0.0.0.0', port=7860)