Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmS21 committed May 20, 2024
1 parent cff5fac commit a888317
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dagger/src/main/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ async def send(self, encoded_message: str, mobile: str, textBelt: Secret) -> str
phone_numbers = mobile.split(',')
text_belt_key = await textBelt.plaintext()
for phone_number in phone_numbers:
print('***', phone_number)
curl_cmd = f"curl -X POST https://textbelt.com/text --data-urlencode phone='{phone_number}' --data-urlencode message='{encoded_message}' -d key='{text_belt_key}'"
try:
result = await (
Expand All @@ -102,7 +103,7 @@ async def send(self, encoded_message: str, mobile: str, textBelt: Secret) -> str
raise ValueError(f"Failed to send message to {phone_number}: {result}")
except Exception as e:
raise RuntimeError(f"Error sending message to {phone_number}: {e}")
return phone_numbers
return result

if __name__ == "__main__":

Expand Down

0 comments on commit a888317

Please sign in to comment.