Last active
July 2, 2022 20:26
-
-
Save spark-shadow/7a03decfda97e6da7606880d9db85456 to your computer and use it in GitHub Desktop.
CSTICKER - CROP STICKER AS 1:1 RATIO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Shadow = require('../Utilis/events') | |
const { MessageType, Mimetype } = require("@adiwajshing/baileys"); | |
const { sticker, addExif, cropsticker } = require("../Utilis/fFmpeg"); | |
//csticker by lyfe ser | |
//re edited & created as external by Shadow... | |
Shadow.addCommand( //by shadow... | |
{ pattern: "cs ?(.*)", fromMe: true, desc: "croped sticker maker" }, | |
async (message, match) => { | |
if ( | |
!message.reply_message || | |
(!message.reply_message.video && !message.reply_message.image) | |
) //csticker re edited & created as external by shadow | |
return await message.sendMessage('Replay to a photo or video'); | |
let location = await message.reply_message.downloadAndSaveMediaMessage( | |
"sticker" | |
); //csticker by shadow | |
if (message.reply_message.image == true) { | |
let buffer = await cropsticker("cimagesticker", location, 1, match); | |
return await message.sendMessage( | |
buffer, | |
{ mimetype: Mimetype.webp, quoted: message.quoted }, | |
MessageType.sticker | |
); //csticker re edited & created as external by shadow | |
} else if (message.reply_message.video == true) { | |
let buffer = await cropsticker( | |
"canimatedsticker", | |
location, | |
message.reply_message.seconds < 10 ? 2 : 3, | |
match | |
); //csticker re edited & created as external by shadow | |
return await message.sendMessage( | |
buffer, | |
{ mimetype: Mimetype.webp, isAnimated: true, quoted: message.quoted }, | |
MessageType.sticker | |
); //csticker re edited & created as external by shadow | |
} //thanks to lyfe ser | |
} //use and enjoy... | |
); //******************* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment