DBFahrerKaterchen3 commited on
Commit
7aa6b20
·
verified ·
1 Parent(s): b50e991

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -2
app.py CHANGED
@@ -21,11 +21,27 @@ def serve_html():
21
  @app.post("/send")
22
  def send(name: str = Form(...), message: str = Form(...)):
23
  payload = {
24
- "content": f"📩 Neue Nachricht:\n**Von:** {name}\n**Nachricht:**\n{message}"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  }
26
 
27
- requests.post(WEBHOOK, json=payload)
28
  return {"status": "ok"}
29
 
30
 
 
31
  app.mount("/static", StaticFiles(directory="static"), name="static")
 
21
  @app.post("/send")
22
  def send(name: str = Form(...), message: str = Form(...)):
23
  payload = {
24
+ "username": "Kontakt | ProjektBayernBahn",
25
+ "avatar_url": "/static/623012.png",
26
+ "embeds": [
27
+ {
28
+ "title": "Neue Kontaktanfrage",
29
+ "description": "Es ist eine neue Nachricht eingegangen.",
30
+ "color": 0x3498db, # Blau
31
+ "fields": [
32
+ {"name": "Name", "value": name, "inline": False},
33
+ {"name": "Nachricht", "value": message, "inline": False}
34
+ ],
35
+ "footer": {
36
+ "text": "ProjektBayernBahn Kontakt"
37
+ }
38
+ }
39
+ ]
40
  }
41
 
42
+ r = requests.post(WEBHOOK, json=payload)
43
  return {"status": "ok"}
44
 
45
 
46
+
47
  app.mount("/static", StaticFiles(directory="static"), name="static")