@open-wa/wa-automate 4.71.9 → 4.71.10
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.d.ts +17 -0
- package/dist/api/Client.js +34 -0
- package/package.json +1 -1
package/dist/api/Client.d.ts
CHANGED
@@ -1913,6 +1913,23 @@ export declare class Client {
|
|
1913
1913
|
* @returns `Promise<string | boolean>` returns status id if it worked, false if it didn't
|
1914
1914
|
*/
|
1915
1915
|
postTextStatus(text: Content, textRgba: string, backgroundRgba: string, font: number): Promise<MessageId | string | boolean>;
|
1916
|
+
/**
|
1917
|
+
* {@license:restricted@}
|
1918
|
+
*
|
1919
|
+
* Sends a formatted text story with a thumbnail.
|
1920
|
+
* @param url The URL to share in the story
|
1921
|
+
* @param text The text to be displayed in the story
|
1922
|
+
* @param textRgba The colour of the text in the story in hex format, make sure to add the alpha value also. E.g "#FF00F4F2"
|
1923
|
+
* @param backgroundRgba The colour of the background in the story in hex format, make sure to add the alpha value also. E.g "#4FF31FF2"
|
1924
|
+
* @param font The font of the text to be used in the story. This has to be a number. Each number refers to a specific predetermined font. Here are the fonts you can choose from:
|
1925
|
+
* @param thumbnail base64 thumbnail override, if not provided the link server will try to figure it out.
|
1926
|
+
* 0: Sans Serif
|
1927
|
+
* 1: Serif
|
1928
|
+
* 2: [Norican Regular](https://fonts.google.com/specimen/Norican)
|
1929
|
+
* 3: [Bryndan Write](https://www.dafontfree.net/freefonts-bryndan-write-f160189.htm)
|
1930
|
+
* @returns `Promise<MessageId>` returns status id if it worked, false if it didn't
|
1931
|
+
*/
|
1932
|
+
postThumbnailStatus(url: string, text: Content, textRgba: string, backgroundRgba: string, font: number, thumbnail?: Base64): Promise<MessageId>;
|
1916
1933
|
/**
|
1917
1934
|
* {@license:restricted@}
|
1918
1935
|
*
|
package/dist/api/Client.js
CHANGED
@@ -3850,6 +3850,40 @@ class Client {
|
|
3850
3850
|
return yield this.pup(({ text, textRgba, backgroundRgba, font }) => WAPI.postTextStatus(text, textRgba, backgroundRgba, font), { text, textRgba, backgroundRgba, font });
|
3851
3851
|
});
|
3852
3852
|
}
|
3853
|
+
/**
|
3854
|
+
* {@license:restricted@}
|
3855
|
+
*
|
3856
|
+
* Sends a formatted text story with a thumbnail.
|
3857
|
+
* @param url The URL to share in the story
|
3858
|
+
* @param text The text to be displayed in the story
|
3859
|
+
* @param textRgba The colour of the text in the story in hex format, make sure to add the alpha value also. E.g "#FF00F4F2"
|
3860
|
+
* @param backgroundRgba The colour of the background in the story in hex format, make sure to add the alpha value also. E.g "#4FF31FF2"
|
3861
|
+
* @param font The font of the text to be used in the story. This has to be a number. Each number refers to a specific predetermined font. Here are the fonts you can choose from:
|
3862
|
+
* @param thumbnail base64 thumbnail override, if not provided the link server will try to figure it out.
|
3863
|
+
* 0: Sans Serif
|
3864
|
+
* 1: Serif
|
3865
|
+
* 2: [Norican Regular](https://fonts.google.com/specimen/Norican)
|
3866
|
+
* 3: [Bryndan Write](https://www.dafontfree.net/freefonts-bryndan-write-f160189.htm)
|
3867
|
+
* @returns `Promise<MessageId>` returns status id if it worked, false if it didn't
|
3868
|
+
*/
|
3869
|
+
postThumbnailStatus(url, text, textRgba, backgroundRgba, font, thumbnail) {
|
3870
|
+
var _a;
|
3871
|
+
return __awaiter(this, void 0, void 0, function* () {
|
3872
|
+
let linkData;
|
3873
|
+
let thumb = thumbnail;
|
3874
|
+
try {
|
3875
|
+
linkData = (yield axios_1.default.get(`${((_a = this._createConfig) === null || _a === void 0 ? void 0 : _a.linkParser) || "https://link.openwa.cloud/api"}?url=${url}`)).data;
|
3876
|
+
logging_1.log.info("Got link data");
|
3877
|
+
if (!thumbnail)
|
3878
|
+
thumb = yield (0, tools_1.getDUrl)(linkData.image);
|
3879
|
+
}
|
3880
|
+
catch (error) {
|
3881
|
+
console.error(error);
|
3882
|
+
}
|
3883
|
+
const { title, description } = linkData;
|
3884
|
+
return yield this.pup(({ thumb, url, title, description, text, textRgba, backgroundRgba, font }) => WAPI.sendStoryWithThumb(thumb, url, title, description, text, textRgba, backgroundRgba, font), { thumb, url, title, description, text, textRgba, backgroundRgba, font });
|
3885
|
+
});
|
3886
|
+
}
|
3853
3887
|
/**
|
3854
3888
|
* {@license:restricted@}
|
3855
3889
|
*
|
package/package.json
CHANGED