Spaces:
Running
Running
Commit
·
6d13c24
1
Parent(s):
b2f9359
update send message
Browse files
app.py
CHANGED
|
@@ -138,14 +138,23 @@ agent = CodeAgent(
|
|
| 138 |
def send_message(user_input):
|
| 139 |
try:
|
| 140 |
# Create the email message
|
| 141 |
-
print("sending mail")
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
|
| 150 |
return f"Message sent to tianqing successfully!"
|
| 151 |
except Exception as e:
|
|
|
|
| 138 |
def send_message(user_input):
|
| 139 |
try:
|
| 140 |
# Create the email message
|
| 141 |
+
#print("sending mail")
|
| 142 |
+
print("sending message")
|
| 143 |
+
#proxy_client = TwilioHttpClient()
|
| 144 |
+
#proxy_client.session.proxies = {'https': os.environ['https_proxy']}
|
| 145 |
+
client = Client(account_sid, auth_token)
|
| 146 |
+
message = client.messages.create(
|
| 147 |
+
from_='whatsapp:+14155238886',
|
| 148 |
+
body='f{query}',
|
| 149 |
+
to=f'whatsapp:{PHONE}'
|
| 150 |
+
)
|
| 151 |
+
|
| 152 |
+
# with smtplib.SMTP("smtp.gmail.com",8888) as connection:
|
| 153 |
+
# connection.starttls()
|
| 154 |
+
# connection.login(MY_EMAIL, MY_PASSWORD)
|
| 155 |
+
# connection.sendmail(from_addr=MY_EMAIL,
|
| 156 |
+
# to_addrs=MY_EMAIL,
|
| 157 |
+
# msg=f"Subject: message from chatbot \n\n{user_input}")
|
| 158 |
|
| 159 |
return f"Message sent to tianqing successfully!"
|
| 160 |
except Exception as e:
|