Skip to content

Commit

Permalink
fix: move URL to init()
Browse files Browse the repository at this point in the history
  • Loading branch information
filipporomani authored Jan 12, 2023
1 parent cb6626d commit 0638368
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion heyoo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(self, token=None, phone_number_id=None):
self.token = token
self.phone_number_id = phone_number_id
self.base_url = "https://graph.facebook.com/v14.0"
self.v15_base_url = "https://graph.facebook.com/v15.0"
self.url = f"{self.base_url}/{phone_number_id}/messages"

self.headers = {
Expand Down Expand Up @@ -507,7 +508,7 @@ def mark_as_read(self, message_id: str):
'message_id': message_id,
}
response = requests.post(
f'https://graph.facebook.com/v15.0/{self.phone_number_id}/messages', headers=headers, json=json_data).json()
f'{self.v15_base_url}/{self.phone_number_id}/messages', headers=headers, json=json_data).json()
return response["success"]

def create_button(self, button):
Expand Down

0 comments on commit 0638368

Please sign in to comment.