Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable automatic conversion by default and do not leave messages in already read #13

Open
eXKPe opened this issue Jan 21, 2025 · 0 comments

Comments

@eXKPe
Copy link

eXKPe commented Jan 21, 2025

It turns out that since I haven't found anything to guide me on how to disable the automatic conversion and keep the messages read, I've taken on the task of modifying the code, although I'd rather be told the real way to prevent someone who sends me an image or video from converting it suddenly without using the command, and also not leaving the messages read in case they send me something important.

        // Image to Sticker (Auto && Caption)
        if ((message.type == "image" || message.type == "video" || message.type  == "gif") && (message._data.caption == `${config.prefix}sticker`)) {
            if (config.log) console.log(`[${'!'.red}] ${message.from.replace("@c.us", "").yellow} created sticker`);
            client.sendMessage(message.from, "*[⏳]* Loading..");
            try {
                const media = await message.downloadMedia();
                client.sendMessage(message.from, media, {
                    sendMediaAsSticker: true,
                    stickerName: config.name, // Sticker Name = Edit in 'config/config.json'
                    stickerAuthor: config.author // Sticker Author = Edit in 'config/config.json'
                }).then(() => {
                    client.sendMessage(message.from, "*[✅]* Successfully!");
                });
            } catch {
                client.sendMessage(message.from, "*[❎]* Failed!");
            }} else {
            client.getChatById(message.id.remote).then(async (chat) => {
                await chat.markUnread();
            });
        }
    }
});

client.initialize();

English is not my main language, please excuse me for using translators to communicate, muchas gracias por el apoyo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant