@sapphire/framework
Version:
Discord bot framework built for advanced and amazing bots.
52 lines (49 loc) • 2.5 kB
JavaScript
;
var v10 = require('discord-api-types/v10');
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var optionTypeToPrettyName = /* @__PURE__ */ new Map([
[v10.ApplicationCommandOptionType.Subcommand, "subcommand"],
[v10.ApplicationCommandOptionType.SubcommandGroup, "subcommand group"],
[v10.ApplicationCommandOptionType.String, "string option"],
[v10.ApplicationCommandOptionType.Integer, "integer option"],
[v10.ApplicationCommandOptionType.Boolean, "boolean option"],
[v10.ApplicationCommandOptionType.User, "user option"],
[v10.ApplicationCommandOptionType.Channel, "channel option"],
[v10.ApplicationCommandOptionType.Role, "role option"],
[v10.ApplicationCommandOptionType.Mentionable, "mentionable option"],
[v10.ApplicationCommandOptionType.Number, "number option"],
[v10.ApplicationCommandOptionType.Attachment, "attachment option"]
]);
var contextMenuTypes = [v10.ApplicationCommandType.Message, v10.ApplicationCommandType.User];
var subcommandTypes = [v10.ApplicationCommandOptionType.SubcommandGroup, v10.ApplicationCommandOptionType.Subcommand];
function hasMinMaxValueSupport(option) {
return [v10.ApplicationCommandOptionType.Integer, v10.ApplicationCommandOptionType.Number].includes(option.type);
}
__name(hasMinMaxValueSupport, "hasMinMaxValueSupport");
function hasChoicesAndAutocompleteSupport(option) {
return [
v10.ApplicationCommandOptionType.Integer,
//
v10.ApplicationCommandOptionType.Number,
v10.ApplicationCommandOptionType.String
].includes(option.type);
}
__name(hasChoicesAndAutocompleteSupport, "hasChoicesAndAutocompleteSupport");
function hasMinMaxLengthSupport(option) {
return option.type === v10.ApplicationCommandOptionType.String;
}
__name(hasMinMaxLengthSupport, "hasMinMaxLengthSupport");
function hasChannelTypesSupport(option) {
return option.type === v10.ApplicationCommandOptionType.Channel;
}
__name(hasChannelTypesSupport, "hasChannelTypesSupport");
exports.contextMenuTypes = contextMenuTypes;
exports.hasChannelTypesSupport = hasChannelTypesSupport;
exports.hasChoicesAndAutocompleteSupport = hasChoicesAndAutocompleteSupport;
exports.hasMinMaxLengthSupport = hasMinMaxLengthSupport;
exports.hasMinMaxValueSupport = hasMinMaxValueSupport;
exports.optionTypeToPrettyName = optionTypeToPrettyName;
exports.subcommandTypes = subcommandTypes;
//# sourceMappingURL=_shared.cjs.map
//# sourceMappingURL=_shared.cjs.map