From e4450c8417624b71d779cb4f41692538f9165e10 Mon Sep 17 00:00:00 2001 From: sowgro Date: Sat, 2 Sep 2023 19:12:47 -0400 Subject: first commit --- .../discord.js/src/structures/ButtonComponent.js | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 node_modules/discord.js/src/structures/ButtonComponent.js (limited to 'node_modules/discord.js/src/structures/ButtonComponent.js') diff --git a/node_modules/discord.js/src/structures/ButtonComponent.js b/node_modules/discord.js/src/structures/ButtonComponent.js new file mode 100644 index 0000000..7319c3a --- /dev/null +++ b/node_modules/discord.js/src/structures/ButtonComponent.js @@ -0,0 +1,65 @@ +'use strict'; + +const Component = require('./Component'); + +/** + * Represents a button component + * @extends {Component} + */ +class ButtonComponent extends Component { + /** + * The style of this button + * @type {ButtonStyle} + * @readonly + */ + get style() { + return this.data.style; + } + + /** + * The label of this button + * @type {?string} + * @readonly + */ + get label() { + return this.data.label ?? null; + } + + /** + * The emoji used in this button + * @type {?APIMessageComponentEmoji} + * @readonly + */ + get emoji() { + return this.data.emoji ?? null; + } + + /** + * Whether this button is disabled + * @type {boolean} + * @readonly + */ + get disabled() { + return this.data.disabled ?? false; + } + + /** + * The custom id of this button (only defined on non-link buttons) + * @type {?string} + * @readonly + */ + get customId() { + return this.data.custom_id ?? null; + } + + /** + * The URL of this button (only defined on link buttons) + * @type {?string} + * @readonly + */ + get url() { + return this.data.url ?? null; + } +} + +module.exports = ButtonComponent; -- cgit v1.2.3