Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/orkestral/venom
Browse files Browse the repository at this point in the history
  • Loading branch information
joaosouz4dev committed Nov 6, 2020
2 parents a4be96f + 6a3e13d commit 99f0f36
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 71 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ await client
});

// Generates sticker from the provided animated gif image and sends it (Send image as animated sticker)
// image path imageBase64 A valid gif image is required. You can also send via http/https (http://www.website.com/img.gif)
// image path imageBase64 A valid gif and webp image is required. You can also send via http/https (http://www.website.com/img.gif)
await client
.sendImageAsStickerGif('000000000000@c.us', './image.gif')
.then((result) => {
Expand Down
113 changes: 49 additions & 64 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@types/puppeteer": "^3.0.2",
"@types/sharp": "^0.26.0",
"@typescript-eslint/eslint-plugin": "^4.5.0",
"@typescript-eslint/parser": "^4.3.0",
"@typescript-eslint/parser": "^4.6.1",
"commitizen": "^4.2.2",
"concurrently": "^5.1.0",
"conventional-changelog-cli": "^2.1.0",
Expand All @@ -83,15 +83,15 @@
"pretty-quick": "^3.1.0",
"release-it": "^14.2.0",
"rimraf": "^3.0.2",
"ts-loader": "^8.0.6",
"ts-loader": "^8.0.9",
"typedoc": "^0.19.2",
"typescript": "^3.8.3",
"typescript": "^4.0.5",
"webpack": "^4.44.2",
"webpack-cli": "^4.1.0"
},
"dependencies": {
"atob": "^2.1.2",
"axios": "^0.20.0",
"axios": "^0.21.0",
"boxen": "^4.2.0",
"chalk": "^4.0.0",
"chrome-launcher": "^0.13.1",
Expand Down
4 changes: 2 additions & 2 deletions src/api/layers/sender.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,13 +535,13 @@ export class SenderLayer extends ListenerLayer {
* @param to chatId '000000000000@c.us'
*/
public async sendImageAsStickerGif(to: string, path: string) {
let b64 = await downloadFileImgHttp(path, ['image/gif']);
let b64 = await downloadFileImgHttp(path, ['image/gif', 'image/webp']);
if (!b64) {
b64 = await fileToBase64(path);
}
if (b64) {
const buff = Buffer.from(
b64.replace(/^data:image\/(gif);base64,/, ''),
b64.replace(/^data:image\/(gif|webp);base64,/, ''),
'base64'
);
const mimeInfo = base64MimeType(b64);
Expand Down

0 comments on commit 99f0f36

Please sign in to comment.