This commit is contained in:
Lukian 2023-06-20 15:28:07 +02:00
parent 68f4b60012
commit 41ae7ff4bd
1010 changed files with 38622 additions and 17071 deletions

View file

@ -1,6 +1,7 @@
'use strict';
const { TextInputBuilder: BuildersTextInput, isJSONEncodable } = require('@discordjs/builders');
const { TextInputBuilder: BuildersTextInput } = require('@discordjs/builders');
const { isJSONEncodable } = require('@discordjs/util');
const { toSnakeCase } = require('../util/Transformers');
/**
@ -14,14 +15,11 @@ class TextInputBuilder extends BuildersTextInput {
/**
* Creates a new text input builder from JSON data
* @param {JSONEncodable<APITextInputComponent>|APITextInputComponent} other The other data
* @param {TextInputBuilder|TextInputComponent|APITextInputComponent} other The other data
* @returns {TextInputBuilder}
*/
static from(other) {
if (isJSONEncodable(other)) {
return new this(other.toJSON());
}
return new this(other);
return new this(isJSONEncodable(other) ? other.toJSON() : other);
}
}
@ -29,5 +27,5 @@ module.exports = TextInputBuilder;
/**
* @external BuildersTextInput
* @see {@link https://discord.js.org/#/docs/builders/main/class/TextInputBuilder}
* @see {@link https://discord.js.org/docs/packages/builders/stable/TextInputBuilder:Class}
*/