utilise channel type filtering for channel options

This commit is contained in:
Erik 2022-04-29 20:08:46 +03:00
parent bbfb75498f
commit d9558f9d72
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -25,6 +25,10 @@ const Constants = {
MENTIONABLE: 9, MENTIONABLE: 9,
NUMBER: 10, NUMBER: 10,
FLOAT: 10 FLOAT: 10
},
ChannelTypes: {
TEXT_CHANNEL: 0,
VOICE_CHANNEL: 3
} }
}; };
@ -128,7 +132,8 @@ class CommandOption {
choices: this.choices, choices: this.choices,
options: this.options.map((o) => o.shape), options: this.options.map((o) => o.shape),
min_value: this.minimum, min_value: this.minimum,
max_value: this.maximum max_value: this.maximum,
channel_types: Constants.ChannelTypes[this.type] !== undefined ? [Constants.ChannelTypes[this.type]] : null
}; };
} }