epok-toolkit 1.5.2__py3-none-any.whl → 1.6.0__py3-none-any.whl
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.
Potentially problematic release.
This version of epok-toolkit might be problematic. Click here for more details.
- epok_toolkit/messaging/__init__.py +1 -1
- epok_toolkit/messaging/whatsapp_instanced.py +20 -8
- {epok_toolkit-1.5.2.dist-info → epok_toolkit-1.6.0.dist-info}/METADATA +1 -1
- {epok_toolkit-1.5.2.dist-info → epok_toolkit-1.6.0.dist-info}/RECORD +7 -7
- {epok_toolkit-1.5.2.dist-info → epok_toolkit-1.6.0.dist-info}/WHEEL +0 -0
- {epok_toolkit-1.5.2.dist-info → epok_toolkit-1.6.0.dist-info}/licenses/LICENSE +0 -0
- {epok_toolkit-1.5.2.dist-info → epok_toolkit-1.6.0.dist-info}/top_level.txt +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
from .whatsapp_instanced import send_text
|
|
1
|
+
from .whatsapp_instanced import send_text, send_media
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from colorstreak import log
|
|
1
2
|
from .whatsapp import WhatsappClient
|
|
2
3
|
from django.conf import settings
|
|
3
4
|
from celery import shared_task
|
|
@@ -9,16 +10,27 @@ SERVER_URL = settings.SERVER_URL
|
|
|
9
10
|
|
|
10
11
|
@shared_task
|
|
11
12
|
def send_whatsapp_message_async(number: str, message: str):
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
log.debug(f"Enviando mensaje a {number}: '{message}'")
|
|
14
|
+
client = WhatsappClient(api_key=API_KEY, server_url=SERVER_URL, instance_name=INSTANCE)
|
|
15
|
+
return client.send_text(number, message)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@shared_task
|
|
19
|
+
def send_whatsapp_media_async(number: str, media_b64: str, filename: str, caption: str, mediatype: str = "document", mimetype: str = "application/pdf"):
|
|
20
|
+
log.debug(f"Enviando media a {number}: '{filename}'")
|
|
21
|
+
client = WhatsappClient(api_key=API_KEY, server_url=SERVER_URL, instance_name=INSTANCE)
|
|
22
|
+
return client.send_media(number, media_b64, filename, caption, mediatype, mimetype)
|
|
23
|
+
|
|
24
|
+
|
|
15
25
|
|
|
16
|
-
client = WhatsappClient(api_key=API_KEY, server_url=SERVER_URL, instance_name=INSTANCE)
|
|
17
|
-
return client.send_text(number, message)
|
|
18
|
-
except Exception as e:
|
|
19
|
-
log.error(f"Error al enviar mensaje a {number}: {e}")
|
|
20
26
|
|
|
21
27
|
def send_text(number: str, message: str):
|
|
22
28
|
from colorstreak import log
|
|
23
29
|
log.debug(f"Programando tarea para {number}")
|
|
24
|
-
send_whatsapp_message_async.delay(number, message)
|
|
30
|
+
send_whatsapp_message_async.delay(number, message)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def send_media(number: str, media_b64: str, filename: str, caption: str, mediatype: str = "document", mimetype: str = "application/pdf"):
|
|
34
|
+
from colorstreak import log
|
|
35
|
+
log.debug(f"Programando tarea para enviar media a {number}")
|
|
36
|
+
send_whatsapp_media_async.delay(number, media_b64, filename, caption, mediatype, mimetype)
|
|
@@ -5,9 +5,9 @@ epok_toolkit/email/__init__.py,sha256=pyJwysyVoq6DuYAG72fulsKFoOuAfjw3aBH7FhmYGH
|
|
|
5
5
|
epok_toolkit/email/email_async.py,sha256=oC0WowWNUpTpXdxo6hJag5gWUaStxI6VBEArEKQxXko,1521
|
|
6
6
|
epok_toolkit/email/engine.py,sha256=IIifqRI9z76pHdrO5oSSZ25aP5txOTAgrj1JuVVPlMY,2387
|
|
7
7
|
epok_toolkit/email/templates.py,sha256=uO3gYn2iiGxcjxioaG066gGPts1m-3C1Gp7XatGgVOg,7578
|
|
8
|
-
epok_toolkit/messaging/__init__.py,sha256=
|
|
8
|
+
epok_toolkit/messaging/__init__.py,sha256=lo0URCOr8tR62ljc0MWTtYZ_YR-tecQaAhhAbyGcOxs,53
|
|
9
9
|
epok_toolkit/messaging/whatsapp.py,sha256=TrMSiKzvnhWOotSDEGil1BGgOJ7jLK7h3MXKdW3zCJw,14114
|
|
10
|
-
epok_toolkit/messaging/whatsapp_instanced.py,sha256=
|
|
10
|
+
epok_toolkit/messaging/whatsapp_instanced.py,sha256=q1CR--9N7IsR5MSf6Fps_l0zpHzTBFcJnB5nw14a28U,1414
|
|
11
11
|
epok_toolkit/pdf/__init__.py,sha256=Scb1iOYnVIUEiUVHLNaPmcigyD-jOSBs3ws5RmolMKE,33
|
|
12
12
|
epok_toolkit/pdf/ticket_pdf.py,sha256=ce21N7OyaSQkfZvOL4c0mEFv7XSGajlOzL-gNb8vBro,8989
|
|
13
13
|
epok_toolkit/pdf/fuentes/Kollektif-Bold.ttf,sha256=MiaucCL_aPGhbDl6M0xA2g2nf84MXHGciOd-XSw0XRo,78780
|
|
@@ -16,8 +16,8 @@ epok_toolkit/pdf/fuentes/Kollektif-Italic.ttf,sha256=1CXPyw43il9u0tQ_7aRzsEaVtg3
|
|
|
16
16
|
epok_toolkit/pdf/fuentes/Kollektif.ttf,sha256=7wTLkVVNUm1giLjIZcWRUH5r2r3o0GjdKic4V1A-pNQ,51128
|
|
17
17
|
epok_toolkit/pdf/plantillas/Ticket_congrats.png,sha256=OSQhVR0j_nLHE6kSJ33BTR-77HM1fNAfJBe2EuX6wVk,157141
|
|
18
18
|
epok_toolkit/pdf/plantillas/Ticket_congrats2.png,sha256=1RBogBdo-8WSMpD3H73HoLgJtr5EC5oVKfOCIWOxPSo,373605
|
|
19
|
-
epok_toolkit-1.
|
|
20
|
-
epok_toolkit-1.
|
|
21
|
-
epok_toolkit-1.
|
|
22
|
-
epok_toolkit-1.
|
|
23
|
-
epok_toolkit-1.
|
|
19
|
+
epok_toolkit-1.6.0.dist-info/licenses/LICENSE,sha256=iLDbGXdLSIOT5OsxzHCvtmxHtonE21GiFlS3LNkug4A,128
|
|
20
|
+
epok_toolkit-1.6.0.dist-info/METADATA,sha256=jMrP_7XOpAwTpD2wv4TewTqL3ZLd0rfML_7xCWFI04Q,739
|
|
21
|
+
epok_toolkit-1.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
22
|
+
epok_toolkit-1.6.0.dist-info/top_level.txt,sha256=Wo72AqIFcfWwBGM5F5iGFw9PrO3WBnTSprFZIJk_pNg,13
|
|
23
|
+
epok_toolkit-1.6.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|