Spaces:
Sleeping
Sleeping
Neurolingua
commited on
Commit
•
bcf8e3e
1
Parent(s):
1a1cf31
Update app.py
Browse files
app.py
CHANGED
@@ -329,6 +329,18 @@ def incoming_whatsapp():
|
|
329 |
|
330 |
message.body("I'm sorry, I don't understand that command.")
|
331 |
return str(response)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
def send_initial_message(to_number):
|
333 |
send_message(
|
334 |
f'whatsapp:{to_number}',
|
|
|
329 |
|
330 |
message.body("I'm sorry, I don't understand that command.")
|
331 |
return str(response)
|
332 |
+
|
333 |
+
def send_message(to, body):
|
334 |
+
try:
|
335 |
+
message = client.messages.create(
|
336 |
+
from_=from_whatsapp_number,
|
337 |
+
body=body,
|
338 |
+
to=to
|
339 |
+
)
|
340 |
+
print(f"Message sent with SID: {message.sid}")
|
341 |
+
except Exception as e:
|
342 |
+
print(f"Error sending message: {e}")
|
343 |
+
|
344 |
def send_initial_message(to_number):
|
345 |
send_message(
|
346 |
f'whatsapp:{to_number}',
|