forked from discordjs/discord.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChannelSelectMenuBuilder.js
33 lines (28 loc) · 967 Bytes
/
ChannelSelectMenuBuilder.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'use strict';
const { ChannelSelectMenuBuilder: BuildersChannelSelectMenu, isJSONEncodable } = require('@discordjs/builders');
const { toSnakeCase } = require('../util/Transformers');
/**
* Class used to build select menu components to be sent through the API
* @extends {BuildersChannelSelectMenu}
*/
class ChannelSelectMenuBuilder extends BuildersChannelSelectMenu {
constructor(data = {}) {
super(toSnakeCase(data));
}
/**
* Creates a new select menu builder from json data
* @param {JSONEncodable<APISelectMenuComponent> | APISelectMenuComponent} other The other data
* @returns {ChannelSelectMenuBuilder}
*/
static from(other) {
if (isJSONEncodable(other)) {
return new this(other.toJSON());
}
return new this(other);
}
}
module.exports = ChannelSelectMenuBuilder;
/**
* @external BuildersChannelSelectMenu
* @see {@link https://discord.js.org/docs/packages/builders/main/ChannelSelectMenuBuilder:Class}
*/