@open-wa/wa-automate 4.23.1 → 4.23.5
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.
- package/dist/api/Client.js +7 -2
- package/dist/api/model/config.d.ts +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/setup.js +1 -1
- package/package.json +1 -1
package/dist/api/Client.js
CHANGED
@@ -266,7 +266,10 @@ class Client {
|
|
266
266
|
const ident = typeof ((_f = this._createConfig) === null || _f === void 0 ? void 0 : _f.autoEmoji) === "string" ? (_g = this._createConfig) === null || _g === void 0 ? void 0 : _g.autoEmoji : ":";
|
267
267
|
this.onMessage((message) => __awaiter(this, void 0, void 0, function* () {
|
268
268
|
if (message.body && message.body.startsWith(ident) && message.body.endsWith(ident)) {
|
269
|
-
|
269
|
+
const emojiId = message.body.replace(new RegExp(ident, 'g'), "");
|
270
|
+
if (!emojiId)
|
271
|
+
return;
|
272
|
+
return yield this.sendEmoji(message.from, emojiId, message.id);
|
270
273
|
}
|
271
274
|
}));
|
272
275
|
}
|
@@ -1087,6 +1090,8 @@ class Client {
|
|
1087
1090
|
return __awaiter(this, void 0, void 0, function* () {
|
1088
1091
|
if (!content)
|
1089
1092
|
content = '';
|
1093
|
+
if (typeof content !== 'string')
|
1094
|
+
content = String(content);
|
1090
1095
|
const err = [
|
1091
1096
|
'Not able to send message to broadcast',
|
1092
1097
|
'Not a contact',
|
@@ -2793,7 +2798,7 @@ class Client {
|
|
2793
2798
|
a.stickerMetadata = { discord: this._createConfig.discord };
|
2794
2799
|
}
|
2795
2800
|
try {
|
2796
|
-
const { data } = yield axios_1.default.post(`${((fallback ? pkg.stickerUrl : 'https://
|
2801
|
+
const { data } = yield axios_1.default.post(`${((fallback ? pkg.stickerUrl : 'https://sticker-api.openwa.dev') || this._createConfig.stickerServerEndpoint).replace(/\/$/, '')}/${func}`, Object.assign(Object.assign({}, a), { sessionInfo, config: this.getConfig() }), {
|
2797
2802
|
maxBodyLength: 20000000,
|
2798
2803
|
maxContentLength: 1500000 // 1.5mb response body limit
|
2799
2804
|
});
|
@@ -545,7 +545,7 @@ export interface ConfigObject {
|
|
545
545
|
*
|
546
546
|
* Redundant until self-hostable sticker server is available.
|
547
547
|
*
|
548
|
-
* @default `https://
|
548
|
+
* @default `https://sticker-api.openwa.dev`
|
549
549
|
*/
|
550
550
|
stickerServerEndpoint?: string | boolean;
|
551
551
|
/**
|
package/dist/cli/index.js
CHANGED
@@ -20,7 +20,7 @@ const axios_1 = __importDefault(require("axios"));
|
|
20
20
|
const setup_1 = require("./setup");
|
21
21
|
const collections_1 = require("./collections");
|
22
22
|
const server_1 = require("./server");
|
23
|
-
let checkUrl = is_url_superb_1.default;
|
23
|
+
let checkUrl = (s) => (typeof s === "string") && is_url_superb_1.default(s);
|
24
24
|
const ready = (config) => __awaiter(void 0, void 0, void 0, function* () {
|
25
25
|
if (process.send) {
|
26
26
|
process.send('ready');
|
package/dist/cli/setup.js
CHANGED
@@ -353,7 +353,7 @@ const cli = () => {
|
|
353
353
|
booleanDefault: undefined
|
354
354
|
});
|
355
355
|
const cliConfig = Object.assign(Object.assign(Object.assign({ sessionId: "session" }, _cli.flags), (exports.configFile(_cli.flags.config) || {})), exports.envArgs());
|
356
|
-
const PORT = cliConfig.port || process.env.PORT || 8080;
|
356
|
+
const PORT = Number(cliConfig.port || process.env.PORT || 8080);
|
357
357
|
const spinner = new events_1.Spin(cliConfig.sessionId, 'STARTUP', cliConfig === null || cliConfig === void 0 ? void 0 : cliConfig.disableSpins);
|
358
358
|
const createConfig = Object.assign({}, cliConfig);
|
359
359
|
if (cliConfig === null || cliConfig === void 0 ? void 0 : cliConfig.session) {
|
package/package.json
CHANGED