commit
This commit is contained in:
parent
68f4b60012
commit
41ae7ff4bd
1010 changed files with 38622 additions and 17071 deletions
12
node_modules/discord.js/src/structures/ButtonBuilder.js
generated
vendored
12
node_modules/discord.js/src/structures/ButtonBuilder.js
generated
vendored
|
@ -1,6 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
const { ButtonBuilder: BuildersButton, isJSONEncodable } = require('@discordjs/builders');
|
||||
const { ButtonBuilder: BuildersButton } = require('@discordjs/builders');
|
||||
const { isJSONEncodable } = require('@discordjs/util');
|
||||
const { toSnakeCase } = require('../util/Transformers');
|
||||
const { resolvePartialEmoji } = require('../util/Util');
|
||||
|
||||
|
@ -27,14 +28,11 @@ class ButtonBuilder extends BuildersButton {
|
|||
|
||||
/**
|
||||
* Creates a new button builder from JSON data
|
||||
* @param {JSONEncodable<APIButtonComponent>|APIButtonComponent} other The other data
|
||||
* @param {ButtonBuilder|ButtonComponent|APIButtonComponent} other The other data
|
||||
* @returns {ButtonBuilder}
|
||||
*/
|
||||
static from(other) {
|
||||
if (isJSONEncodable(other)) {
|
||||
return new this(other.toJSON());
|
||||
}
|
||||
return new this(other);
|
||||
return new this(isJSONEncodable(other) ? other.toJSON() : other);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,5 +40,5 @@ module.exports = ButtonBuilder;
|
|||
|
||||
/**
|
||||
* @external BuildersButton
|
||||
* @see {@link https://discord.js.org/#/docs/builders/main/class/ButtonBuilder}
|
||||
* @see {@link https://discord.js.org/docs/packages/builders/stable/ButtonBuilder:Class}
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue