commit
This commit is contained in:
parent
a15c733e45
commit
2a5130cbda
2838 changed files with 288613 additions and 0 deletions
33
node_modules/discord.js/src/structures/TextInputBuilder.js
generated
vendored
Normal file
33
node_modules/discord.js/src/structures/TextInputBuilder.js
generated
vendored
Normal 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}
|
||||
*/
|
Loading…
Add table
Add a link
Reference in a new issue