whatsapp-python 3.3.9__tar.gz → 3.3.9.post1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/.github/workflows/python-publish.yml +4 -4
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/PKG-INFO +2 -2
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/README.md +1 -1
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/whatsapp/__init__.py +2 -12
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/whatsapp/constants.py +1 -1
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/whatsapp/ext/_message.py +0 -1
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/whatsapp/ext/_send_media.py +0 -24
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/whatsapp/ext/_send_others.py +5 -16
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/.github/FUNDING.yml +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/.github/ISSUE_TEMPLATE/custom.md +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/.github/dependabot.yml +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/.github/workflows/codeql.yml +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/.github/workflows/dependency-review.yml +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/.gitignore +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/CODE_OF_CONDUCT.md +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/CONTRIBUTING.md +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/LICENSE +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/SECURITY.md +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/examples/reply_to_message_obj.py +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/examples/sending_audio.py +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/examples/sending_button.py +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/examples/sending_document.py +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/examples/sending_image.py +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/examples/sending_location.py +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/examples/sending_message.py +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/examples/sending_template_message.py +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/examples/sending_video.py +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/examples/standalone_hook.py +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/pyproject.toml +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/whatsapp/ext/_buttons.py +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/whatsapp/ext/_media.py +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/whatsapp/ext/_property.py +0 -0
- {whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/whatsapp/ext/_static.py +0 -0
|
@@ -16,21 +16,21 @@ permissions:
|
|
|
16
16
|
contents: read
|
|
17
17
|
|
|
18
18
|
jobs:
|
|
19
|
-
|
|
19
|
+
deployment:
|
|
20
20
|
|
|
21
21
|
runs-on: ubuntu-latest
|
|
22
|
-
|
|
22
|
+
environment: publish
|
|
23
23
|
steps:
|
|
24
24
|
- uses: actions/checkout@v4
|
|
25
25
|
- name: Set up Python
|
|
26
26
|
uses: actions/setup-python@v3
|
|
27
27
|
with:
|
|
28
28
|
python-version: '3.12'
|
|
29
|
-
- name: Install
|
|
29
|
+
- name: Install packages
|
|
30
30
|
run: |
|
|
31
31
|
python -m pip install --upgrade pip
|
|
32
32
|
pip install build
|
|
33
|
-
- name:
|
|
33
|
+
- name: Building...
|
|
34
34
|
run: python -m build
|
|
35
35
|
- name: Publish package
|
|
36
36
|
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: whatsapp-python
|
|
3
|
-
Version: 3.3.9
|
|
3
|
+
Version: 3.3.9.post1
|
|
4
4
|
Summary: Open source Python wrapper for the WhatsApp Cloud API
|
|
5
5
|
Project-URL: Homepage, https://github.com/filipporomani/whatsapp-python
|
|
6
6
|
Project-URL: Docs, https://github.com/filipporomani/whatsapp-python/wiki
|
|
@@ -107,7 +107,7 @@ Whereas using third-party providers of the WhatsApp API can result in monthly fe
|
|
|
107
107
|
All the prices are available in the [**WhatsApp API docs**](https://developers.facebook.com/docs/whatsapp/pricing).
|
|
108
108
|
|
|
109
109
|
> [!TIP]
|
|
110
|
-
>
|
|
110
|
+
> I recomend to use a test number, as you you can get a free one and use it for testing purposes.
|
|
111
111
|
|
|
112
112
|
## Migrating from `Neurotech-HQ/heyoo`
|
|
113
113
|
|
|
@@ -71,7 +71,7 @@ Whereas using third-party providers of the WhatsApp API can result in monthly fe
|
|
|
71
71
|
All the prices are available in the [**WhatsApp API docs**](https://developers.facebook.com/docs/whatsapp/pricing).
|
|
72
72
|
|
|
73
73
|
> [!TIP]
|
|
74
|
-
>
|
|
74
|
+
> I recomend to use a test number, as you you can get a free one and use it for testing purposes.
|
|
75
75
|
|
|
76
76
|
## Migrating from `Neurotech-HQ/heyoo`
|
|
77
77
|
|
|
@@ -34,12 +34,10 @@ class WhatsApp(object):
|
|
|
34
34
|
logging.getLogger(__name__).addHandler(logging.NullHandler())
|
|
35
35
|
|
|
36
36
|
self.l = phone_number_id
|
|
37
|
-
print(self.l)
|
|
38
37
|
|
|
39
38
|
if isinstance(phone_number_id, dict):
|
|
40
39
|
# use first phone number id as default
|
|
41
40
|
phone_number_id = phone_number_id[list(phone_number_id.keys())[0]]
|
|
42
|
-
print(phone_number_id)
|
|
43
41
|
|
|
44
42
|
elif phone_number_id == "":
|
|
45
43
|
logging.error("Phone number ID not provided")
|
|
@@ -48,7 +46,6 @@ class WhatsApp(object):
|
|
|
48
46
|
elif isinstance(phone_number_id, str):
|
|
49
47
|
logging.critical(
|
|
50
48
|
"The phone number ID should be a dictionary of phone numbers and their IDs. Using strings is deprecated and will be removed in the next version.")
|
|
51
|
-
print(phone_number_id)
|
|
52
49
|
else:
|
|
53
50
|
pass
|
|
54
51
|
|
|
@@ -305,11 +302,9 @@ class Message(object):
|
|
|
305
302
|
logging.info(f"Replying to {self.id}")
|
|
306
303
|
r = requests.post(self.url, headers=self.headers, json=payload)
|
|
307
304
|
if r.status_code == 200:
|
|
308
|
-
logging.info(f"Message sent to {
|
|
309
|
-
self.instance.get_author(self.data)}")
|
|
305
|
+
logging.info(f"Message sent to {self.instance.get_author(self.data)}")
|
|
310
306
|
return r.json()
|
|
311
|
-
logging.info(f"Message not sent to {
|
|
312
|
-
self.instance.get_author(self.data)}")
|
|
307
|
+
logging.info(f"Message not sent to {self.instance.get_author(self.data)}")
|
|
313
308
|
logging.info(f"Status code: {r.status_code}")
|
|
314
309
|
logging.error(f"Response: {r.json()}")
|
|
315
310
|
return r.json()
|
|
@@ -335,14 +330,10 @@ class Message(object):
|
|
|
335
330
|
|
|
336
331
|
try:
|
|
337
332
|
sender = dict(self.instance.l)[sender]
|
|
338
|
-
print(self.instance.l)
|
|
339
|
-
print(sender)
|
|
340
333
|
|
|
341
334
|
|
|
342
|
-
print(12)
|
|
343
335
|
|
|
344
336
|
except:
|
|
345
|
-
print(22)
|
|
346
337
|
sender = self.instance.phone_number_id
|
|
347
338
|
|
|
348
339
|
if sender == None:
|
|
@@ -357,7 +348,6 @@ class Message(object):
|
|
|
357
348
|
"text": {"preview_url": preview_url, "body": self.content},
|
|
358
349
|
}
|
|
359
350
|
logging.info(f"Sending message to {self.to}")
|
|
360
|
-
print(url)
|
|
361
351
|
r = requests.post(url, headers=self.headers, json=data)
|
|
362
352
|
if r.status_code == 200:
|
|
363
353
|
logging.info(f"Message sent to {self.to}")
|
|
@@ -20,14 +20,10 @@ def send_location(self, lat: str, long: str, name: str, address: str, recipient_
|
|
|
20
20
|
"""
|
|
21
21
|
try:
|
|
22
22
|
sender = dict(self.instance.l)[sender]
|
|
23
|
-
print(self.instance.l)
|
|
24
|
-
print(sender)
|
|
25
23
|
|
|
26
24
|
|
|
27
|
-
print(12)
|
|
28
25
|
|
|
29
26
|
except:
|
|
30
|
-
print(22)
|
|
31
27
|
sender = self.instance.phone_number_id
|
|
32
28
|
|
|
33
29
|
if sender == None:
|
|
@@ -86,14 +82,10 @@ def send_image(
|
|
|
86
82
|
"""
|
|
87
83
|
try:
|
|
88
84
|
sender = dict(self.l)[sender]
|
|
89
|
-
print(self.l)
|
|
90
|
-
print(sender)
|
|
91
85
|
|
|
92
86
|
|
|
93
|
-
print(12)
|
|
94
87
|
|
|
95
88
|
except:
|
|
96
|
-
print(22)
|
|
97
89
|
sender = self.phone_number_id
|
|
98
90
|
|
|
99
91
|
if sender == None:
|
|
@@ -148,14 +140,10 @@ def send_sticker(self, sticker: str, recipient_id: str, recipient_type: str = "i
|
|
|
148
140
|
"""
|
|
149
141
|
try:
|
|
150
142
|
sender = dict(self.l)[sender]
|
|
151
|
-
print(self.l)
|
|
152
|
-
print(sender)
|
|
153
143
|
|
|
154
144
|
|
|
155
|
-
print(12)
|
|
156
145
|
|
|
157
146
|
except:
|
|
158
|
-
print(22)
|
|
159
147
|
sender = self.phone_number_id
|
|
160
148
|
|
|
161
149
|
if sender == None:
|
|
@@ -206,14 +194,10 @@ def send_audio(self, audio: str, recipient_id: str, link: bool = True, sender =
|
|
|
206
194
|
"""
|
|
207
195
|
try:
|
|
208
196
|
sender = dict(self.l)[sender]
|
|
209
|
-
print(self.l)
|
|
210
|
-
print(sender)
|
|
211
197
|
|
|
212
198
|
|
|
213
|
-
print(12)
|
|
214
199
|
|
|
215
200
|
except:
|
|
216
|
-
print(22)
|
|
217
201
|
sender = self.phone_number_id
|
|
218
202
|
|
|
219
203
|
if sender == None:
|
|
@@ -265,14 +249,10 @@ def send_video(
|
|
|
265
249
|
"""
|
|
266
250
|
try:
|
|
267
251
|
sender = dict(self.l)[sender]
|
|
268
|
-
print(self.l)
|
|
269
|
-
print(sender)
|
|
270
252
|
|
|
271
253
|
|
|
272
|
-
print(12)
|
|
273
254
|
|
|
274
255
|
except:
|
|
275
|
-
print(22)
|
|
276
256
|
sender = self.phone_number_id
|
|
277
257
|
|
|
278
258
|
if sender == None:
|
|
@@ -324,14 +304,10 @@ def send_document(
|
|
|
324
304
|
"""
|
|
325
305
|
try:
|
|
326
306
|
sender = dict(self.l)[sender]
|
|
327
|
-
print(self.l)
|
|
328
|
-
print(sender)
|
|
329
307
|
|
|
330
308
|
|
|
331
|
-
print(12)
|
|
332
309
|
|
|
333
310
|
except:
|
|
334
|
-
print(22)
|
|
335
311
|
sender = self.phone_number_id
|
|
336
312
|
|
|
337
313
|
if sender == None:
|
|
@@ -3,7 +3,7 @@ import requests
|
|
|
3
3
|
import logging
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
def send_custom_json(self, data: dict, recipient_id: str = "", sender=
|
|
6
|
+
def send_custom_json(self, data: dict, recipient_id: str = "", sender=None):
|
|
7
7
|
"""
|
|
8
8
|
Sends a custom json to a WhatsApp user. This can be used to send custom objects to the message endpoint.
|
|
9
9
|
|
|
@@ -20,16 +20,10 @@ def send_custom_json(self, data: dict, recipient_id: str = "", sender= None):
|
|
|
20
20
|
"""
|
|
21
21
|
try:
|
|
22
22
|
sender = dict(self.l)[sender]
|
|
23
|
-
print(self.l)
|
|
24
|
-
print(sender)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
print(12)
|
|
28
23
|
|
|
29
24
|
except:
|
|
30
|
-
print(22)
|
|
31
25
|
sender = self.phone_number_id
|
|
32
|
-
|
|
26
|
+
|
|
33
27
|
if sender == None:
|
|
34
28
|
sender = self.phone_number_id
|
|
35
29
|
|
|
@@ -39,7 +33,8 @@ def send_custom_json(self, data: dict, recipient_id: str = "", sender= None):
|
|
|
39
33
|
if "to" in data.keys():
|
|
40
34
|
data_recipient_id = data["to"]
|
|
41
35
|
logging.info(
|
|
42
|
-
f"Recipient Id is defined in data ({data_recipient_id}) and recipient_id parameter ({recipient_id})"
|
|
36
|
+
f"Recipient Id is defined in data ({data_recipient_id}) and recipient_id parameter ({recipient_id})"
|
|
37
|
+
)
|
|
43
38
|
else:
|
|
44
39
|
data["to"] = recipient_id
|
|
45
40
|
|
|
@@ -86,16 +81,10 @@ def send_contacts(
|
|
|
86
81
|
"""
|
|
87
82
|
try:
|
|
88
83
|
sender = dict(self.l)[sender]
|
|
89
|
-
print(self.l)
|
|
90
|
-
print(sender)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
print(12)
|
|
94
84
|
|
|
95
85
|
except:
|
|
96
|
-
print(22)
|
|
97
86
|
sender = self.phone_number_id
|
|
98
|
-
|
|
87
|
+
|
|
99
88
|
if sender == None:
|
|
100
89
|
sender = self.phone_number_id
|
|
101
90
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/.github/ISSUE_TEMPLATE/feature_request.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{whatsapp_python-3.3.9 → whatsapp_python-3.3.9.post1}/.github/workflows/dependency-review.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|