-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
BaseSelectMenuComponent.js
56 lines (49 loc) · 1018 Bytes
/
BaseSelectMenuComponent.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
'use strict';
const Component = require('./Component');
/**
* Represents a select menu component
* @extends {Component}
*/
class BaseSelectMenuComponent extends Component {
/**
* The placeholder for this select menu
* @type {?string}
* @readonly
*/
get placeholder() {
return this.data.placeholder ?? null;
}
/**
* The maximum amount of options that can be selected
* @type {?number}
* @readonly
*/
get maxValues() {
return this.data.max_values ?? null;
}
/**
* The minimum amount of options that must be selected
* @type {?number}
* @readonly
*/
get minValues() {
return this.data.min_values ?? null;
}
/**
* The custom id of this select menu
* @type {string}
* @readonly
*/
get customId() {
return this.data.custom_id;
}
/**
* Whether this select menu is disabled
* @type {boolean}
* @readonly
*/
get disabled() {
return this.data.disabled ?? false;
}
}
module.exports = BaseSelectMenuComponent;