Button Click false

- Link Button
- Button Disable
This commit is contained in:
March 7th
2022-03-24 21:45:23 +07:00
parent a51d06c874
commit b0b3f8579c
3 changed files with 12 additions and 3 deletions

View File

@@ -165,10 +165,11 @@ class MessageButton extends BaseMessageComponent {
/**
* Click the button
* @param {Message} message Discord Message
* @returns true if the button is clicked
* @returns {boolean}
*/
async click(message) {
if (!message instanceof Message) throw new Error("[UNKNOWN_MESSAGE] Please pass a valid Message");
if (!this.customId || this.style == 5 || this.disabled) return false; // Button URL, Disabled
await message.client.api.interactions.post(
{
data: {