This commit is contained in:
Lukian LEIZOUR 2023-01-29 00:57:47 +01:00
parent a15c733e45
commit 2a5130cbda
2838 changed files with 288613 additions and 0 deletions

View file

@ -0,0 +1,33 @@
'use strict';
const { TextInputBuilder: BuildersTextInput, isJSONEncodable } = require('@discordjs/builders');
const { toSnakeCase } = require('../util/Transformers');
/**
* Represents a text input builder.
* @extends {BuildersTextInput}
*/
class TextInputBuilder extends BuildersTextInput {
constructor(data) {
super(toSnakeCase(data));
}
/**
* Creates a new text input builder from JSON data
* @param {JSONEncodable<APITextInputComponent>|APITextInputComponent} other The other data
* @returns {TextInputBuilder}
*/
static from(other) {
if (isJSONEncodable(other)) {
return new this(other.toJSON());
}
return new this(other);
}
}
module.exports = TextInputBuilder;
/**
* @external BuildersTextInput
* @see {@link https://discord.js.org/#/docs/builders/main/class/TextInputBuilder}
*/