Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
filipporomani committed Sep 13, 2024
1 parent 730fc3c commit 60688f4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions whatsapp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ def mark_as_read(self) -> dict:
logging.error(response.json())
return response.json()

def send(self,sender, preview_url: bool = True) -> dict:
print(sender)
def send(self,sender = None, preview_url: bool = True) -> dict:

try:
sender = dict(self.instance.l)[sender]
print(self.instance.l)
Expand All @@ -344,6 +344,9 @@ def send(self,sender, preview_url: bool = True) -> dict:
except:
print(22)
sender = self.instance.phone_number_id

if sender == None:
sender = self.instance.phone_number_id

url = f"https://graph.facebook.com/v18.0/{sender}/messages"
data = {
Expand Down

0 comments on commit 60688f4

Please sign in to comment.