@open-wa/wa-automate 4.35.2 → 4.35.5
Sign up to get free protection for your applications and to get access to all the features.
package/dist/api/Client.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
import { Page } from 'puppeteer';
|
3
|
-
import { Chat, LiveLocationChangedEvent, ChatState, ChatMuteDuration, GroupChatCreationResponse } from './model/chat';
|
3
|
+
import { Chat, LiveLocationChangedEvent, ChatState, ChatMuteDuration, GroupChatCreationResponse, EphemeralDuration } from './model/chat';
|
4
4
|
import { Contact, NumberCheck } from './model/contact';
|
5
5
|
import { Message } from './model/message';
|
6
6
|
import { AxiosRequestConfig } from 'axios';
|
@@ -485,7 +485,7 @@ export declare class Client {
|
|
485
485
|
*/
|
486
486
|
sendPaymentRequest(to: ChatId, amount: number, currency: string, message?: string): Promise<boolean | MessageId>;
|
487
487
|
/**
|
488
|
-
* Send generic quick reply buttons
|
488
|
+
* Send generic quick reply buttons. This is an insiders feature for MD accounts.
|
489
489
|
*
|
490
490
|
* @param {ChatId} to chat id
|
491
491
|
* @param {string} body The body of the buttons message
|
@@ -493,7 +493,7 @@ export declare class Client {
|
|
493
493
|
* @param {string} title The title/header of the buttons message
|
494
494
|
* @param {string} footer The footer of the buttons message
|
495
495
|
*/
|
496
|
-
sendButtons(to: ChatId, body: string, buttons: Button[], title
|
496
|
+
sendButtons(to: ChatId, body: string, buttons: Button[], title?: string, footer?: string): Promise<boolean | MessageId>;
|
497
497
|
/**
|
498
498
|
* Send a banner image
|
499
499
|
*
|
@@ -1551,10 +1551,10 @@ export declare class Client {
|
|
1551
1551
|
*
|
1552
1552
|
* Turn the ephemeral setting in a chat to on or off
|
1553
1553
|
* @param chatId The ID of the chat
|
1554
|
-
* @param ephemeral `true` to turn on the ephemeral setting, `false` to turn off the ephemeral setting.
|
1554
|
+
* @param ephemeral `true` to turn on the ephemeral setting to 1 day, `false` to turn off the ephemeral setting. Other options: `604800 | 7776000`
|
1555
1555
|
* @returns `Promise<boolean>` true if the setting was set, `false` if the chat does not exist
|
1556
1556
|
*/
|
1557
|
-
setChatEphemeral(chatId: ChatId, ephemeral: boolean): Promise<boolean>;
|
1557
|
+
setChatEphemeral(chatId: ChatId, ephemeral: EphemeralDuration | boolean): Promise<boolean>;
|
1558
1558
|
/**
|
1559
1559
|
* Send a giphy GIF as an animated sticker.
|
1560
1560
|
* @param to ChatId
|
package/dist/api/Client.js
CHANGED
@@ -1272,7 +1272,7 @@ class Client {
|
|
1272
1272
|
});
|
1273
1273
|
}
|
1274
1274
|
/**
|
1275
|
-
* Send generic quick reply buttons
|
1275
|
+
* Send generic quick reply buttons. This is an insiders feature for MD accounts.
|
1276
1276
|
*
|
1277
1277
|
* @param {ChatId} to chat id
|
1278
1278
|
* @param {string} body The body of the buttons message
|
@@ -3203,7 +3203,7 @@ class Client {
|
|
3203
3203
|
*
|
3204
3204
|
* Turn the ephemeral setting in a chat to on or off
|
3205
3205
|
* @param chatId The ID of the chat
|
3206
|
-
* @param ephemeral `true` to turn on the ephemeral setting, `false` to turn off the ephemeral setting.
|
3206
|
+
* @param ephemeral `true` to turn on the ephemeral setting to 1 day, `false` to turn off the ephemeral setting. Other options: `604800 | 7776000`
|
3207
3207
|
* @returns `Promise<boolean>` true if the setting was set, `false` if the chat does not exist
|
3208
3208
|
*/
|
3209
3209
|
setChatEphemeral(chatId, ephemeral) {
|
package/dist/api/model/chat.d.ts
CHANGED
@@ -207,3 +207,7 @@ export interface GroupChatCreationResponse {
|
|
207
207
|
ContactId?: GroupChatCreationParticipantAddResponse;
|
208
208
|
}[];
|
209
209
|
}
|
210
|
+
/**
|
211
|
+
* Ephemeral duration can be 1 day, 7 days or 90 days. The default is 1 day.
|
212
|
+
*/
|
213
|
+
export declare type EphemeralDuration = 86400 | 604800 | 7776000;
|
@@ -39,6 +39,7 @@ const update_notifier_1 = __importDefault(require("update-notifier"));
|
|
39
39
|
const Client_1 = require("../api/Client");
|
40
40
|
const index_1 = require("../api/model/index");
|
41
41
|
const path = __importStar(require("path"));
|
42
|
+
const os = __importStar(require("os"));
|
42
43
|
const auth_1 = require("./auth");
|
43
44
|
const browser_1 = require("./browser");
|
44
45
|
const events_1 = require("./events");
|
@@ -148,6 +149,8 @@ function create(config = {}) {
|
|
148
149
|
sessionId = 'session';
|
149
150
|
const spinner = new events_1.Spin(sessionId, 'STARTUP', config === null || config === void 0 ? void 0 : config.disableSpins);
|
150
151
|
const qrManager = new auth_1.QRManager(config);
|
152
|
+
const RAM_INFO = `Total: ${parseFloat(`${os.totalmem() / 1000000000}`).toFixed(2)} GB | Free: ${parseFloat(`${os.freemem() / 1000000000}`).toFixed(2)} GB`;
|
153
|
+
logging_1.log.info("RAM INFO", RAM_INFO);
|
151
154
|
try {
|
152
155
|
if (typeof config === 'string')
|
153
156
|
console.error("AS OF VERSION 3+ YOU CAN NO LONGER SET THE SESSION ID AS THE FIRST PARAMETER OF CREATE. CREATE CAN ONLY TAKE A CONFIG OBJECT. IF YOU STILL HAVE CONFIGS AS A SECOND PARAMETER, THEY WILL HAVE NO EFFECT! PLEASE SEE DOCS.");
|
@@ -203,7 +206,8 @@ function create(config = {}) {
|
|
203
206
|
WA_AUTOMATE_VERSION,
|
204
207
|
BROWSER_VERSION,
|
205
208
|
OS,
|
206
|
-
START_TS
|
209
|
+
START_TS,
|
210
|
+
RAM_INFO
|
207
211
|
};
|
208
212
|
if ((config === null || config === void 0 ? void 0 : config.logDebugInfoAsObject) || (config === null || config === void 0 ? void 0 : config.disableSpins))
|
209
213
|
spinner.succeed(`Debug info: ${JSON.stringify(debugInfo, null, 2)}`);
|
package/package.json
CHANGED