Skip to content

Commit

Permalink
[client] Added request location
Browse files Browse the repository at this point in the history
  • Loading branch information
yehuda-lev committed Dec 20, 2023
1 parent 50434bf commit 4fccf4a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pywa/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,14 @@ def send_location(
address=address,
)["messages"][0]["id"]

def request_location(self, to: str | int, text: str) -> dict[str, dict | list]:
return self.api.send_interactive_message(
to=str(to),
type_="location_request_message",
action={"name": "send_location"},
body=text,
)

def send_contact(
self,
to: str | int,
Expand Down
3 changes: 3 additions & 0 deletions pywa/types/base_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,9 @@ def reply_location(
address=address,
)

def reply_request_location(self, text: str) -> dict[str, dict | list]:
return self._client.request_location(to=self.sender, text=text)

def reply_contact(
self,
contact: Contact | Iterable[Contact],
Expand Down

0 comments on commit 4fccf4a

Please sign in to comment.