bzapper 0.8.1 → 0.8.2
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.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/bzapper/resources/messages.rb +48 -16
- data/lib/bzapper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c256b4bd21ae63812d103200cd409f3219afd1312e5bd1294a35c6bc917b437c
|
|
4
|
+
data.tar.gz: 2d90d51e0b528128c7d86096cb865116089c4fe4a88f7be2a5fa82f118994979
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4649dc966b6e70b094a9df4474312444d0e62b7b5b3c247ca23faa8d469b1a361768060e96aaeb00e45a9e062fc3164070e1bf5e2bd89fdddbea5d8ba3bd28e1
|
|
7
|
+
data.tar.gz: cbf1117963bde306d24d7044531758245712e71dabed736281ee20496476dda531aee8be965a98fa93402d645e11cf840a8b332a6abe4135040dd463efec77a5
|
data/README.md
CHANGED
|
@@ -10,13 +10,13 @@ Zero dependências de runtime (só biblioteca padrão: `net/http`, `json`, `open
|
|
|
10
10
|
## Instalação
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
gem install bzapper -v 0.8.
|
|
13
|
+
gem install bzapper -v 0.8.2
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
Ou no `Gemfile` — **fixe a versão exata** (cada release declara se muda a superfície pública):
|
|
17
17
|
|
|
18
18
|
```ruby
|
|
19
|
-
gem "bzapper", "0.8.
|
|
19
|
+
gem "bzapper", "0.8.2"
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Hello world
|
|
@@ -125,7 +125,7 @@ m.send_document(to: to, media: { url: "https://example.com/nota.pdf", filename:
|
|
|
125
125
|
m.send_audio(to: to, media: { url: "https://example.com/audio.ogg", ptt: true }) # ptt = mensagem de voz
|
|
126
126
|
m.send_sticker(to: to, media: { url: "https://example.com/sticker.webp" })
|
|
127
127
|
m.send_location(to: to, latitude: -23.5613, longitude: -46.6565, name: "Av. Paulista")
|
|
128
|
-
m.send_contact(to: to, contact_name: "Berni Software",
|
|
128
|
+
m.send_contact(to: to, contact_name: "Berni Software", contact_phone: "+5511977776666")
|
|
129
129
|
m.send_poll(to: to, name: "Pizza ou sushi?", options: %w[Pizza Sushi], selectable_count: 1)
|
|
130
130
|
m.send_reaction(to: to, quoted_message_id: "ABCD1234", emoji: "👍") # emoji "" remove
|
|
131
131
|
m.send_buttons(to: to, body: "Escolha:", buttons: [{ id: "a", title: "Opção A" }, { id: "b", title: "Opção B" }])
|
|
@@ -17,7 +17,9 @@ module Bzapper
|
|
|
17
17
|
# instance_id/pool_id, it AUTOMATICALLY reuses the number that already talks to `to`, ensuring
|
|
18
18
|
# the whole interaction stays on the same number. Default **true**; send **false** to force
|
|
19
19
|
# rotation (e.g. campaign/broadcast).
|
|
20
|
-
# @param to [String] (corpo) Destination E.164 phone
|
|
20
|
+
# @param to [String] (corpo) Destination: E.164 phone (+DDIdigits), contact JID
|
|
21
|
+
# (…@s.whatsapp.net), group JID (…@g.us) or the contact's @lid. A @lid is translated to the
|
|
22
|
+
# phone when the connected number knows it; the official rail accepts phone only.
|
|
21
23
|
# @param quoted_message_id [String, nil] (corpo) Quoted wa_message_id (reply).
|
|
22
24
|
# @param quoted_participant [String, nil] (corpo) Author (phone or JID) of the quoted/reacted
|
|
23
25
|
# message. Only needed in groups when the quoted message is not in bZapper history — otherwise
|
|
@@ -80,7 +82,9 @@ module Bzapper
|
|
|
80
82
|
# instance_id/pool_id, it AUTOMATICALLY reuses the number that already talks to `to`, ensuring
|
|
81
83
|
# the whole interaction stays on the same number. Default **true**; send **false** to force
|
|
82
84
|
# rotation (e.g. campaign/broadcast).
|
|
83
|
-
# @param to [String] (corpo) Destination E.164 phone
|
|
85
|
+
# @param to [String] (corpo) Destination: E.164 phone (+DDIdigits), contact JID
|
|
86
|
+
# (…@s.whatsapp.net), group JID (…@g.us) or the contact's @lid. A @lid is translated to the
|
|
87
|
+
# phone when the connected number knows it; the official rail accepts phone only.
|
|
84
88
|
# @param quoted_message_id [String, nil] (corpo) Quoted wa_message_id (reply).
|
|
85
89
|
# @param quoted_participant [String, nil] (corpo) Author (phone or JID) of the quoted/reacted
|
|
86
90
|
# message. Only needed in groups when the quoted message is not in bZapper history — otherwise
|
|
@@ -143,7 +147,9 @@ module Bzapper
|
|
|
143
147
|
# instance_id/pool_id, it AUTOMATICALLY reuses the number that already talks to `to`, ensuring
|
|
144
148
|
# the whole interaction stays on the same number. Default **true**; send **false** to force
|
|
145
149
|
# rotation (e.g. campaign/broadcast).
|
|
146
|
-
# @param to [String] (corpo) Destination E.164 phone
|
|
150
|
+
# @param to [String] (corpo) Destination: E.164 phone (+DDIdigits), contact JID
|
|
151
|
+
# (…@s.whatsapp.net), group JID (…@g.us) or the contact's @lid. A @lid is translated to the
|
|
152
|
+
# phone when the connected number knows it; the official rail accepts phone only.
|
|
147
153
|
# @param quoted_message_id [String, nil] (corpo) Quoted wa_message_id (reply).
|
|
148
154
|
# @param quoted_participant [String, nil] (corpo) Author (phone or JID) of the quoted/reacted
|
|
149
155
|
# message. Only needed in groups when the quoted message is not in bZapper history — otherwise
|
|
@@ -206,7 +212,9 @@ module Bzapper
|
|
|
206
212
|
# instance_id/pool_id, it AUTOMATICALLY reuses the number that already talks to `to`, ensuring
|
|
207
213
|
# the whole interaction stays on the same number. Default **true**; send **false** to force
|
|
208
214
|
# rotation (e.g. campaign/broadcast).
|
|
209
|
-
# @param to [String] (corpo) Destination E.164 phone
|
|
215
|
+
# @param to [String] (corpo) Destination: E.164 phone (+DDIdigits), contact JID
|
|
216
|
+
# (…@s.whatsapp.net), group JID (…@g.us) or the contact's @lid. A @lid is translated to the
|
|
217
|
+
# phone when the connected number knows it; the official rail accepts phone only.
|
|
210
218
|
# @param quoted_message_id [String, nil] (corpo) Quoted wa_message_id (reply).
|
|
211
219
|
# @param quoted_participant [String, nil] (corpo) Author (phone or JID) of the quoted/reacted
|
|
212
220
|
# message. Only needed in groups when the quoted message is not in bZapper history — otherwise
|
|
@@ -270,7 +278,9 @@ module Bzapper
|
|
|
270
278
|
# instance_id/pool_id, it AUTOMATICALLY reuses the number that already talks to `to`, ensuring
|
|
271
279
|
# the whole interaction stays on the same number. Default **true**; send **false** to force
|
|
272
280
|
# rotation (e.g. campaign/broadcast).
|
|
273
|
-
# @param to [String] (corpo) Destination E.164 phone
|
|
281
|
+
# @param to [String] (corpo) Destination: E.164 phone (+DDIdigits), contact JID
|
|
282
|
+
# (…@s.whatsapp.net), group JID (…@g.us) or the contact's @lid. A @lid is translated to the
|
|
283
|
+
# phone when the connected number knows it; the official rail accepts phone only.
|
|
274
284
|
# @param quoted_message_id [String, nil] (corpo) Quoted wa_message_id (reply).
|
|
275
285
|
# @param quoted_participant [String, nil] (corpo) Author (phone or JID) of the quoted/reacted
|
|
276
286
|
# message. Only needed in groups when the quoted message is not in bZapper history — otherwise
|
|
@@ -333,7 +343,9 @@ module Bzapper
|
|
|
333
343
|
# instance_id/pool_id, it AUTOMATICALLY reuses the number that already talks to `to`, ensuring
|
|
334
344
|
# the whole interaction stays on the same number. Default **true**; send **false** to force
|
|
335
345
|
# rotation (e.g. campaign/broadcast).
|
|
336
|
-
# @param to [String] (corpo) Destination E.164 phone
|
|
346
|
+
# @param to [String] (corpo) Destination: E.164 phone (+DDIdigits), contact JID
|
|
347
|
+
# (…@s.whatsapp.net), group JID (…@g.us) or the contact's @lid. A @lid is translated to the
|
|
348
|
+
# phone when the connected number knows it; the official rail accepts phone only.
|
|
337
349
|
# @param quoted_message_id [String, nil] (corpo) Quoted wa_message_id (reply).
|
|
338
350
|
# @param quoted_participant [String, nil] (corpo) Author (phone or JID) of the quoted/reacted
|
|
339
351
|
# message. Only needed in groups when the quoted message is not in bZapper history — otherwise
|
|
@@ -397,7 +409,9 @@ module Bzapper
|
|
|
397
409
|
# instance_id/pool_id, it AUTOMATICALLY reuses the number that already talks to `to`, ensuring
|
|
398
410
|
# the whole interaction stays on the same number. Default **true**; send **false** to force
|
|
399
411
|
# rotation (e.g. campaign/broadcast).
|
|
400
|
-
# @param to [String] (corpo) Destination E.164 phone
|
|
412
|
+
# @param to [String] (corpo) Destination: E.164 phone (+DDIdigits), contact JID
|
|
413
|
+
# (…@s.whatsapp.net), group JID (…@g.us) or the contact's @lid. A @lid is translated to the
|
|
414
|
+
# phone when the connected number knows it; the official rail accepts phone only.
|
|
401
415
|
# @param quoted_message_id [String, nil] (corpo) Quoted wa_message_id (reply).
|
|
402
416
|
# @param quoted_participant [String, nil] (corpo) Author (phone or JID) of the quoted/reacted
|
|
403
417
|
# message. Only needed in groups when the quoted message is not in bZapper history — otherwise
|
|
@@ -467,7 +481,9 @@ module Bzapper
|
|
|
467
481
|
# instance_id/pool_id, it AUTOMATICALLY reuses the number that already talks to `to`, ensuring
|
|
468
482
|
# the whole interaction stays on the same number. Default **true**; send **false** to force
|
|
469
483
|
# rotation (e.g. campaign/broadcast).
|
|
470
|
-
# @param to [String] (corpo) Destination E.164 phone
|
|
484
|
+
# @param to [String] (corpo) Destination: E.164 phone (+DDIdigits), contact JID
|
|
485
|
+
# (…@s.whatsapp.net), group JID (…@g.us) or the contact's @lid. A @lid is translated to the
|
|
486
|
+
# phone when the connected number knows it; the official rail accepts phone only.
|
|
471
487
|
# @param quoted_message_id [String, nil] (corpo) Quoted wa_message_id (reply).
|
|
472
488
|
# @param quoted_participant [String, nil] (corpo) Author (phone or JID) of the quoted/reacted
|
|
473
489
|
# message. Only needed in groups when the quoted message is not in bZapper history — otherwise
|
|
@@ -488,8 +504,12 @@ module Bzapper
|
|
|
488
504
|
# @param force [Boolean, nil] (corpo) OPTIONAL. When true, bypasses an inferred suppression
|
|
489
505
|
# (e.g. opt-out inferred from behaviour) for this send. Does NOT override an explicit
|
|
490
506
|
# suppression entry (`/suppressions`) — use with care and only with a lawful basis.
|
|
491
|
-
# @param contact_name [String, nil] (corpo)
|
|
492
|
-
# @param
|
|
507
|
+
# @param contact_name [String, nil] (corpo) Name shown on the card.
|
|
508
|
+
# @param contact_phone [String, nil] (corpo) The CARD CONTACT's phone in E.164 — the person
|
|
509
|
+
# being shared, never the destination. Required with contact_name (not needed when you send a
|
|
510
|
+
# ready contact_vcard); it is what makes WhatsApp recognise the card as a contact.
|
|
511
|
+
# @param contact_vcard [String, nil] (corpo) Ready vCard; when present,
|
|
512
|
+
# contact_name/contact_phone are not used to build one.
|
|
493
513
|
# @param idempotency_key [String, nil] chave de idempotência (senão a SDK gera uma).
|
|
494
514
|
# @param timeout [Numeric, nil] segundos por tentativa (padrão: o do cliente).
|
|
495
515
|
# @return [Hash, Array, nil] o JSON da resposta, inteiro (nil em 204).
|
|
@@ -498,7 +518,8 @@ module Bzapper
|
|
|
498
518
|
quoted_message_id: UNSET, quoted_participant: UNSET,
|
|
499
519
|
client_reference: UNSET, mentions: UNSET, scheduled_at: UNSET,
|
|
500
520
|
groups: UNSET, tags: UNSET, force: UNSET, contact_name: UNSET,
|
|
501
|
-
|
|
521
|
+
contact_phone: UNSET, contact_vcard: UNSET, idempotency_key: nil,
|
|
522
|
+
timeout: nil)
|
|
502
523
|
payload = compact(
|
|
503
524
|
"instance_id" => instance_id,
|
|
504
525
|
"pool_id" => pool_id,
|
|
@@ -513,6 +534,7 @@ module Bzapper
|
|
|
513
534
|
"tags" => tags,
|
|
514
535
|
"force" => force,
|
|
515
536
|
"contact_name" => contact_name,
|
|
537
|
+
"contact_phone" => contact_phone,
|
|
516
538
|
"contact_vcard" => contact_vcard
|
|
517
539
|
)
|
|
518
540
|
request("POST",
|
|
@@ -533,7 +555,9 @@ module Bzapper
|
|
|
533
555
|
# instance_id/pool_id, it AUTOMATICALLY reuses the number that already talks to `to`, ensuring
|
|
534
556
|
# the whole interaction stays on the same number. Default **true**; send **false** to force
|
|
535
557
|
# rotation (e.g. campaign/broadcast).
|
|
536
|
-
# @param to [String] (corpo) Destination E.164 phone
|
|
558
|
+
# @param to [String] (corpo) Destination: E.164 phone (+DDIdigits), contact JID
|
|
559
|
+
# (…@s.whatsapp.net), group JID (…@g.us) or the contact's @lid. A @lid is translated to the
|
|
560
|
+
# phone when the connected number knows it; the official rail accepts phone only.
|
|
537
561
|
# @param quoted_message_id [String, nil] (corpo) Quoted wa_message_id (reply).
|
|
538
562
|
# @param quoted_participant [String, nil] (corpo) Author (phone or JID) of the quoted/reacted
|
|
539
563
|
# message. Only needed in groups when the quoted message is not in bZapper history — otherwise
|
|
@@ -600,7 +624,9 @@ module Bzapper
|
|
|
600
624
|
# instance_id/pool_id, it AUTOMATICALLY reuses the number that already talks to `to`, ensuring
|
|
601
625
|
# the whole interaction stays on the same number. Default **true**; send **false** to force
|
|
602
626
|
# rotation (e.g. campaign/broadcast).
|
|
603
|
-
# @param to [String] (corpo) Destination E.164 phone
|
|
627
|
+
# @param to [String] (corpo) Destination: E.164 phone (+DDIdigits), contact JID
|
|
628
|
+
# (…@s.whatsapp.net), group JID (…@g.us) or the contact's @lid. A @lid is translated to the
|
|
629
|
+
# phone when the connected number knows it; the official rail accepts phone only.
|
|
604
630
|
# @param quoted_message_id [String] (corpo) Quoted wa_message_id (reply).
|
|
605
631
|
# @param quoted_participant [String, nil] (corpo) Author (phone or JID) of the quoted/reacted
|
|
606
632
|
# message. Only needed in groups when the quoted message is not in bZapper history — otherwise
|
|
@@ -666,7 +692,9 @@ module Bzapper
|
|
|
666
692
|
# instance_id/pool_id, it AUTOMATICALLY reuses the number that already talks to `to`, ensuring
|
|
667
693
|
# the whole interaction stays on the same number. Default **true**; send **false** to force
|
|
668
694
|
# rotation (e.g. campaign/broadcast).
|
|
669
|
-
# @param to [String] (corpo) Destination E.164 phone
|
|
695
|
+
# @param to [String] (corpo) Destination: E.164 phone (+DDIdigits), contact JID
|
|
696
|
+
# (…@s.whatsapp.net), group JID (…@g.us) or the contact's @lid. A @lid is translated to the
|
|
697
|
+
# phone when the connected number knows it; the official rail accepts phone only.
|
|
670
698
|
# @param quoted_message_id [String, nil] (corpo) Quoted wa_message_id (reply).
|
|
671
699
|
# @param quoted_participant [String, nil] (corpo) Author (phone or JID) of the quoted/reacted
|
|
672
700
|
# message. Only needed in groups when the quoted message is not in bZapper history — otherwise
|
|
@@ -734,7 +762,9 @@ module Bzapper
|
|
|
734
762
|
# instance_id/pool_id, it AUTOMATICALLY reuses the number that already talks to `to`, ensuring
|
|
735
763
|
# the whole interaction stays on the same number. Default **true**; send **false** to force
|
|
736
764
|
# rotation (e.g. campaign/broadcast).
|
|
737
|
-
# @param to [String] (corpo) Destination E.164 phone
|
|
765
|
+
# @param to [String] (corpo) Destination: E.164 phone (+DDIdigits), contact JID
|
|
766
|
+
# (…@s.whatsapp.net), group JID (…@g.us) or the contact's @lid. A @lid is translated to the
|
|
767
|
+
# phone when the connected number knows it; the official rail accepts phone only.
|
|
738
768
|
# @param quoted_message_id [String, nil] (corpo) Quoted wa_message_id (reply).
|
|
739
769
|
# @param quoted_participant [String, nil] (corpo) Author (phone or JID) of the quoted/reacted
|
|
740
770
|
# message. Only needed in groups when the quoted message is not in bZapper history — otherwise
|
|
@@ -808,7 +838,9 @@ module Bzapper
|
|
|
808
838
|
# instance_id/pool_id, it AUTOMATICALLY reuses the number that already talks to `to`, ensuring
|
|
809
839
|
# the whole interaction stays on the same number. Default **true**; send **false** to force
|
|
810
840
|
# rotation (e.g. campaign/broadcast).
|
|
811
|
-
# @param to [String] (corpo) Destination E.164 phone
|
|
841
|
+
# @param to [String] (corpo) Destination: E.164 phone (+DDIdigits), contact JID
|
|
842
|
+
# (…@s.whatsapp.net), group JID (…@g.us) or the contact's @lid. A @lid is translated to the
|
|
843
|
+
# phone when the connected number knows it; the official rail accepts phone only.
|
|
812
844
|
# @param quoted_message_id [String, nil] (corpo) Quoted wa_message_id (reply).
|
|
813
845
|
# @param quoted_participant [String, nil] (corpo) Author (phone or JID) of the quoted/reacted
|
|
814
846
|
# message. Only needed in groups when the quoted message is not in bZapper history — otherwise
|
data/lib/bzapper/version.rb
CHANGED