Skip to content

Commit

Permalink
fix: wrong self.instance (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipporomani committed Oct 15, 2024
1 parent e7037cd commit 26fc193
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion whatsapp/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file contains the constants used in the project.
# The VERSION constant is used to store the version of the project - it's not only used in the __init__.py file, but also in the pyproject.toml file.

VERSION = "4.0.1"
VERSION = "4.0.2"
4 changes: 2 additions & 2 deletions whatsapp/ext/_buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def send_button(self, button: Dict[Any, Any], recipient_id: str, sender=None) ->
if sender == None:
sender = self.phone_number_id

url = f"https://graph.facebook.com/{self.instance.LATEST}/{sender}/messages"
url = f"https://graph.facebook.com/{self.LATEST}/{sender}/messages"
data = {
"messaging_product": "whatsapp",
"to": recipient_id,
Expand Down Expand Up @@ -81,7 +81,7 @@ def send_reply_button(
if sender == None:
sender = self.phone_number_id

url = f"https://graph.facebook.com/{self.instance.LATEST}/{sender}/messages"
url = f"https://graph.facebook.com/{self.LATEST}/{sender}/messages"
if len(button["action"]["buttons"]) > 3:
raise ValueError("The maximum number of buttons is 3.")

Expand Down
2 changes: 1 addition & 1 deletion whatsapp/ext/_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def send_template(self, template: str, recipient_id: str, components: str = None
if sender == None:
sender = self.phone_number_id

url = f"https://graph.facebook.com/{self.instance.LATEST}/{sender}/messages"
url = f"https://graph.facebook.com/{self.LATEST}/{sender}/messages"
data = {
"messaging_product": "whatsapp",
"to": recipient_id,
Expand Down
12 changes: 6 additions & 6 deletions whatsapp/ext/_send_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def send_location(self, lat: str, long: str, name: str, address: str, recipient_
if sender == None:
sender = self.phone_number_id

url = f"https://graph.facebook.com/{self.instance.LATEST}/{sender}/messages"
url = f"https://graph.facebook.com/{self.LATEST}/{sender}/messages"
data = {
"messaging_product": "whatsapp",
"to": recipient_id,
Expand Down Expand Up @@ -91,7 +91,7 @@ def send_image(
if sender == None:
sender = self.phone_number_id

url = f"https://graph.facebook.com/{self.instance.LATEST}/{sender}/messages"
url = f"https://graph.facebook.com/{self.LATEST}/{sender}/messages"
if link:
data = {
"messaging_product": "whatsapp",
Expand Down Expand Up @@ -149,7 +149,7 @@ def send_sticker(self, sticker: str, recipient_id: str, recipient_type: str = "i
if sender == None:
sender = self.phone_number_id

url = f"https://graph.facebook.com/{self.instance.LATEST}/{sender}/messages"
url = f"https://graph.facebook.com/{self.LATEST}/{sender}/messages"
if link:
data = {
"messaging_product": "whatsapp",
Expand Down Expand Up @@ -203,7 +203,7 @@ def send_audio(self, audio: str, recipient_id: str, link: bool = True, sender =
if sender == None:
sender = self.phone_number_id

url = f"https://graph.facebook.com/{self.instance.LATEST}/{sender}/messages"
url = f"https://graph.facebook.com/{self.LATEST}/{sender}/messages"
if link:
data = {
"messaging_product": "whatsapp",
Expand Down Expand Up @@ -258,7 +258,7 @@ def send_video(
if sender == None:
sender = self.phone_number_id

url = f"https://graph.facebook.com/{self.instance.LATEST}/{sender}/messages"
url = f"https://graph.facebook.com/{self.LATEST}/{sender}/messages"
if link:
data = {
"messaging_product": "whatsapp",
Expand Down Expand Up @@ -312,7 +312,7 @@ def send_document(
if sender == None:
sender = self.phone_number_id

url = f"https://graph.facebook.com/{self.instance.LATEST}/{sender}/messages"
url = f"https://graph.facebook.com/{self.LATEST}/{sender}/messages"
if link:
data = {
"messaging_product": "whatsapp",
Expand Down
4 changes: 2 additions & 2 deletions whatsapp/ext/_send_others.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def send_custom_json(self, data: dict, recipient_id: str = "", sender=None):
if sender == None:
sender = self.phone_number_id

url = f"https://graph.facebook.com/{self.instance.LATEST}/{sender}/messages"
url = f"https://graph.facebook.com/{self.LATEST}/{sender}/messages"

if recipient_id:
if "to" in data.keys():
Expand Down Expand Up @@ -88,7 +88,7 @@ def send_contacts(
if sender == None:
sender = self.phone_number_id

url = f"https://graph.facebook.com/{self.instance.LATEST}/{sender}/messages"
url = f"https://graph.facebook.com/{self.LATEST}/{sender}/messages"

data = {
"messaging_product": "whatsapp",
Expand Down

0 comments on commit 26fc193

Please sign in to comment.