From 06383683e669d296efead8f30c4b27bea6adf6d8 Mon Sep 17 00:00:00 2001 From: Filippo Romani Date: Thu, 12 Jan 2023 12:36:17 +0100 Subject: [PATCH] fix: move URL to init() --- heyoo/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/heyoo/__init__.py b/heyoo/__init__.py index b91578c..8f94e85 100644 --- a/heyoo/__init__.py +++ b/heyoo/__init__.py @@ -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 = { @@ -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):