Mengkodingan / ckptw

Create powerful WhatsApp bots easily.
https://ckptw.mengkodingan.my.id/
MIT License
39 stars 8 forks source link

[SUGGESTION] Add new updates #16

Closed itsreimau closed 1 month ago

itsreimau commented 2 months ago

Suggestion (Hopefully added)

Can you add a new option to the Client that automatically gets Mentions on texts to be sent. So don't use ctx.getMentioned() on every message to be sent.

import { Client } from "@mengkodingan/ckptw";

const bot = new Client({
    prefix: "!",
    printQRInTerminal: true,
    readIncommingMsg: true,
    autoMentionedMsg: true // This is just an example, whatever you want to call it.
});

ctx.reply({ text: "Hello World!", mentions: ctx.getMentioned() }); // It would take a long time to add them one by one.

ctx.reply({ text: "Hello World!" }); // Like this, automatically using ctx.getMentioned()

Added a function to easily get the media buffer without having to download it using other functions.

// So the buffer media can be retrieved via ctx, or m.

// For ctx
ctx.msg.media.toBuffer();  // Media to buffer
ctx._msg.media.toBuffer(); // Media to buffer
ctx.quoted.media.toBuffer();  // Media to buffer

// For m
m.media.toBuffer(); // Media to Buffer

If you want to add it I would be very happy!

JastinXyz commented 2 months ago

Thank you for your feedback! You can use the latest version of ckptw which already has these features available. Details of what features have been added are at https://github.com/Mengkodingan/ckptw/releases/tag/v4.3.6 👍

Feel free to close this issue if there is nothing more to discuss.

itsreimau commented 1 month ago

Thank you so much, you are so cool! I am very happy now.

itsreimau commented 1 month ago

After I use the media as a capture buffer. There are several commands that experience errors. Such as sticker, hd, and several commands that use media. I'd like you to take a look at my repo. Is there something wrong?