Spaces:
Running
Running
Chandima Prabhath
commited on
Commit
·
07534df
1
Parent(s):
0ffceca
Update weather API endpoint and enhance image generation message for clarity
Browse files
app.py
CHANGED
@@ -242,7 +242,7 @@ async def whatsapp_webhook(request: Request):
|
|
242 |
if low.startswith("/weather "):
|
243 |
loc = body[len("/weather "):].strip().replace(" ", "+")
|
244 |
try:
|
245 |
-
w = requests.get(f"http://wttr.in/{loc}?format=
|
246 |
send_message(mid, chat, w)
|
247 |
except:
|
248 |
send_message(mid, chat, "Could not fetch weather.")
|
@@ -348,7 +348,7 @@ async def whatsapp_webhook(request: Request):
|
|
348 |
if not prompt:
|
349 |
send_message(mid, chat, "Use `/imagine <prompt>`")
|
350 |
else:
|
351 |
-
send_message(mid, chat, "✨
|
352 |
task_queue.put({
|
353 |
"type": "image",
|
354 |
"message_id": mid,
|
|
|
242 |
if low.startswith("/weather "):
|
243 |
loc = body[len("/weather "):].strip().replace(" ", "+")
|
244 |
try:
|
245 |
+
w = requests.get(f"http://sl.wttr.in/{loc}?format=4", timeout=5).text
|
246 |
send_message(mid, chat, w)
|
247 |
except:
|
248 |
send_message(mid, chat, "Could not fetch weather.")
|
|
|
348 |
if not prompt:
|
349 |
send_message(mid, chat, "Use `/imagine <prompt>`")
|
350 |
else:
|
351 |
+
send_message(mid, chat, "✨ Your image is being generated. \nPlease wait...")
|
352 |
task_queue.put({
|
353 |
"type": "image",
|
354 |
"message_id": mid,
|