@open-wa/wa-automate 4.49.0 → 4.49.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -208,7 +208,8 @@ export declare class Client {
208
208
  */
209
209
  onPlugged(fn: (plugged: boolean) => void): Promise<Listener | boolean>;
210
210
  /**
211
- * Requires a Story License Key
211
+ * {@license:restricted@}
212
+ *
212
213
  * Listens to when a contact posts a new story.
213
214
  * @event
214
215
  *
@@ -736,6 +737,13 @@ export declare class Client {
736
737
  * @param quotedMsgId string true_0000000000@c.us_JHB2HB23HJ4B234HJB to send as a reply to a message
737
738
  */
738
739
  sendAudio(to: ChatId, file: AdvancedFile, quotedMsgId?: MessageId): Promise<MessageId>;
740
+ /**
741
+ * Send a poll to a group chat
742
+ * @param to chat id - a group chat is required
743
+ * @param name the name of the poll
744
+ * @param options an array of poll options
745
+ */
746
+ sendPoll(to: GroupChatId, name: string, options: string[]): Promise<MessageId>;
739
747
  /**
740
748
  * Sends a video to given chat as a gif, with caption or not, using base64
741
749
  * @param to chat id `xxxxx@c.us`
@@ -856,7 +856,8 @@ class Client {
856
856
  });
857
857
  }
858
858
  /**
859
- * Requires a Story License Key
859
+ * {@license:restricted@}
860
+ *
860
861
  * Listens to when a contact posts a new story.
861
862
  * @event
862
863
  *
@@ -1817,6 +1818,19 @@ class Client {
1817
1818
  return this.sendFile(to, file, 'file.mp3', '', quotedMsgId, true, false, false, false);
1818
1819
  });
1819
1820
  }
1821
+ /**
1822
+ * Send a poll to a group chat
1823
+ * @param to chat id - a group chat is required
1824
+ * @param name the name of the poll
1825
+ * @param options an array of poll options
1826
+ */
1827
+ sendPoll(to, name, options) {
1828
+ return __awaiter(this, void 0, void 0, function* () {
1829
+ return yield this.pup(({ to, name, options }) => {
1830
+ return WAPI.sendPoll(to, name, options);
1831
+ }, { to, name, options });
1832
+ });
1833
+ }
1820
1834
  /**
1821
1835
  * Sends a video to given chat as a gif, with caption or not, using base64
1822
1836
  * @param to chat id `xxxxx@c.us`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate",
3
- "version": "4.49.0",
3
+ "version": "4.49.2",
4
4
  "licenseCheckUrl": "https://funcs.openwa.dev/license-check",
5
5
  "brokenMethodReportUrl": "https://funcs.openwa.dev/report-bm",
6
6
  "patches": "https://cdn.openwa.dev/patches.json",