underctrl-io / commandkit

Only focus on what matters - Let CommandKit handle your commands and events in your Discord.js projects!
https://commandkit.js.org
MIT License
82 stars 9 forks source link

Add `onEnd` to ButtonKit #40

Closed notunderctrl closed 7 months ago

notunderctrl commented 7 months ago

This PR introduces a new ButtonKit method: onEnd:

Usage:

myButton
    .onClick(
        (buttonInteraction) => {
            buttonInteraction.reply('You clicked a button!');
        },
        { message },
    )
    .onEnd(() => {
        console.log('Button collector ended.');

        myButton.setDisabled(true);
        message.edit({ components: [row] });
    });
netlify[bot] commented 7 months ago

Deploy Preview for commandkit ready!

Name Link
Latest commit 7260c7c0f8f7821519aacd17e053f9a225d795a2
Latest deploy log https://app.netlify.com/sites/commandkit/deploys/6579659f67a96e0009162d8e
Deploy Preview https://deploy-preview-40--commandkit.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

notunderctrl commented 7 months ago

Couldn't sworn I added it xD