2026-07-27 11:26:19 +00:00
// Module ID: 11271
// Function ID: 87641
2026-07-20 16:05:17 +00:00
// Name: isValidRoleMention
2026-07-25 08:10:48 +00:00
// Dependencies: [1922, 4468, 1882, 7960, 44, 1212, 7958, 5674, 7961, 2]
2026-07-20 16:05:17 +00:00
2026-07-27 11:26:19 +00:00
// Module 11271 (isValidRoleMention)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_5 from "_isNativeReflectConstruct" ;
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1 ;
2026-07-20 16:05:17 +00:00
function isValidRoleMention ( applicationCommandOption ) {
let tmp = "roleMention" === applicationCommandOption . type ;
if ( ! tmp ) {
let tmp2 = "textMention" === applicationCommandOption . type ;
if ( tmp2 ) {
tmp2 = "@everyone" === applicationCommandOption . text ;
}
tmp = tmp2 ;
}
return tmp ;
}
2026-07-23 10:11:24 +00:00
function validateNumericOptionRange ( NumberResult , minValue , _8Y5zsp , CyRLmH , VD3Q_S ) {
2026-07-20 16:05:17 +00:00
if ( null == minValue . minValue ) {
let obj = { success : true } ;
return obj ;
}
if ( null != minValue . maxValue ) {
if ( null != minValue . minValue ) {
obj = { success : false } ;
2026-07-23 10:11:24 +00:00
const intl3 = require ( 1212 ) /* getSystemLocale */ . intl ;
2026-07-20 16:05:17 +00:00
obj = { minimum : localeNumberFormat ( minValue . minValue ) , maximum : localeNumberFormat ( minValue . maxValue ) } ;
obj . error = intl3 . formatToPlainString ( _8Y5zsp , obj ) ;
return obj ;
}
}
if ( null != minValue . minValue ) {
const obj1 = { success : false } ;
2026-07-23 10:11:24 +00:00
const intl2 = require ( 1212 ) /* getSystemLocale */ . intl ;
2026-07-20 16:05:17 +00:00
const obj2 = { minimum : localeNumberFormat ( minValue . minValue ) } ;
obj1 . error = intl2 . formatToPlainString ( CyRLmH , obj2 ) ;
return obj1 ;
} else if ( null != minValue . maxValue ) {
const obj3 = { success : false } ;
2026-07-23 10:11:24 +00:00
const intl = require ( 1212 ) /* getSystemLocale */ . intl ;
2026-07-20 16:05:17 +00:00
const obj4 = { maximum : localeNumberFormat ( minValue . maxValue ) } ;
obj3 . error = intl . formatToPlainString ( VD3Q_S , obj4 ) ;
return obj3 ;
}
}
function localeNumberFormat ( minLength ) {
2026-07-23 10:11:24 +00:00
return minLength . toLocaleString ( require ( 1212 ) /* getSystemLocale */ . intl . currentLocale , { useGrouping : false } ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let obj = {
2026-07-25 08:10:48 +00:00
[ arg1 ( 1882 ) . ApplicationCommandOptionType . SUB_COMMAND ] : ( ) = > ( { success : false } ) ,
[ arg1 ( 1882 ) . ApplicationCommandOptionType . SUB_COMMAND_GROUP ] : ( ) = > ( { success : false } ) ,
[ arg1 ( 1882 ) . ApplicationCommandOptionType . BOOLEAN ] : ( type ) = > {
2026-07-20 16:05:17 +00:00
if ( "text" !== type . type ) {
let obj = { success : false } ;
return obj ;
} else {
obj = { } ;
const trimmed = type . text . trim ( ) ;
2026-07-25 08:10:48 +00:00
obj . success = null != require ( 7960 ) /* findChoiceStringValue */ . toChoiceBooleanValue ( trimmed ) ;
2026-07-20 16:05:17 +00:00
return obj ;
}
} ,
2026-07-25 08:10:48 +00:00
[ arg1 ( 1882 ) . ApplicationCommandOptionType . STRING ] : ( type , type2 , id ) = > {
importDefault ( 44 ) ( type2 . type === require ( 1882 ) /* PermissionOverwriteType */ . ApplicationCommandOptionType . STRING , "option type must match validator type" ) ;
2026-07-20 16:05:17 +00:00
type = type . type ;
if ( "emoji" === type ) {
let surrogate = type . surrogate ;
} else if ( "text" === type ) {
surrogate = type . text . trim ( ) ;
const str2 = type . text ;
} else {
let obj = { success : false } ;
return obj ;
}
if ( null != type2 . choices ) {
2026-07-25 08:10:48 +00:00
obj = { success : null != require ( 7960 ) /* findChoiceStringValue */ . findChoiceStringValue ( type2 . choices , surrogate ) } ;
2026-07-20 16:05:17 +00:00
return obj ;
} else {
if ( type2 . autocomplete ) {
2026-07-25 08:10:48 +00:00
let obj1 = require ( 7960 ) /* findChoiceStringValue */ ;
2026-07-20 16:05:17 +00:00
if ( null != obj1 . findAutocompleteChoiceStringValue ( id , type2 . name , surrogate ) ) {
obj = { success : true } ;
return obj ;
}
}
if ( undefined !== type2 . minLength ) {
if ( null == surrogate ) {
obj1 = { success : false } ;
return obj1 ;
} else {
2026-07-23 10:11:24 +00:00
const obj2 = { exactRangeErrorMessage : require ( 1212 ) /* getSystemLocale */ . t [ "e+9/SY" ] , rangeErrorMessage : require ( 1212 ) /* getSystemLocale */ . t . IE1sTh , minErrorMessage : require ( 1212 ) /* getSystemLocale */ . t . rXAFQD , maxErrorMessage : require ( 1212 ) /* getSystemLocale */ . t [ "ycEPx/" ] } ;
2026-07-20 16:05:17 +00:00
if ( undefined === type2 . minLength ) {
if ( undefined !== type2 . maxLength ) {
if ( ! obj3 . success ) {
return obj3 ;
}
}
2026-07-23 10:11:24 +00:00
obj3 = { success : true } ;
2026-07-20 16:05:17 +00:00
}
if ( undefined !== type2 . maxLength ) {
if ( undefined !== type2 . minLength ) {
if ( type2 . minLength === type2 . maxLength ) {
const obj4 = { success : false } ;
2026-07-23 10:11:24 +00:00
const intl4 = require ( 1212 ) /* getSystemLocale */ . intl ;
2026-07-20 16:05:17 +00:00
const obj5 = { value : localeNumberFormat ( type2 . minLength ) } ;
obj4 . error = intl4 . formatToPlainString ( obj2 . exactRangeErrorMessage , obj5 ) ;
obj3 = obj4 ;
}
}
}
if ( undefined !== type2 . maxLength ) {
if ( undefined !== type2 . minLength ) {
const obj6 = { success : false } ;
2026-07-23 10:11:24 +00:00
const intl3 = require ( 1212 ) /* getSystemLocale */ . intl ;
2026-07-20 16:05:17 +00:00
const obj7 = { minimum : localeNumberFormat ( type2 . minLength ) , maximum : localeNumberFormat ( type2 . maxLength ) } ;
obj6 . error = intl3 . formatToPlainString ( obj2 . rangeErrorMessage , obj7 ) ;
obj3 = obj6 ;
}
}
if ( undefined !== type2 . minLength ) {
const obj8 = { success : false } ;
2026-07-23 10:11:24 +00:00
const intl2 = require ( 1212 ) /* getSystemLocale */ . intl ;
2026-07-20 16:05:17 +00:00
const obj9 = { minimum : localeNumberFormat ( type2 . minLength ) } ;
obj8 . error = intl2 . formatToPlainString ( obj2 . minErrorMessage , obj9 ) ;
obj3 = obj8 ;
} else if ( undefined !== type2 . maxLength ) {
const obj10 = { success : false } ;
2026-07-23 10:11:24 +00:00
const intl = require ( 1212 ) /* getSystemLocale */ . intl ;
2026-07-20 16:05:17 +00:00
const obj11 = { maximum : localeNumberFormat ( type2 . maxLength ) } ;
obj10 . error = intl . formatToPlainString ( obj2 . maxErrorMessage , obj11 ) ;
obj3 = obj10 ;
}
}
}
const obj12 = { success : true } ;
return obj12 ;
}
2026-07-23 10:11:24 +00:00
const tmp = importDefault ( 44 ) ;
2026-07-20 16:05:17 +00:00
} ,
2026-07-25 08:10:48 +00:00
[ arg1 ( 1882 ) . ApplicationCommandOptionType . INTEGER ] : ( type , type2 , id ) = > {
importDefault ( 44 ) ( type2 . type === require ( 1882 ) /* PermissionOverwriteType */ . ApplicationCommandOptionType . INTEGER , "option type must match validator type" ) ;
2026-07-20 16:05:17 +00:00
let trimmed = null ;
if ( "text" === type . type ) {
trimmed = type . text . trim ( ) ;
const str = type . text ;
}
if ( null != trimmed ) {
if ( 0 !== trimmed . length ) {
if ( null != type2 . choices ) {
2026-07-25 08:10:48 +00:00
let obj = { success : null != require ( 7960 ) /* findChoiceStringValue */ . findChoiceNumberValue ( type2 . choices , trimmed ) } ;
2026-07-20 16:05:17 +00:00
return obj ;
} else {
if ( type2 . autocomplete ) {
2026-07-25 08:10:48 +00:00
obj = require ( 7960 ) /* findChoiceStringValue */ ;
2026-07-20 16:05:17 +00:00
if ( null != obj . findAutocompleteChoiceNumberValue ( id , type2 . name , trimmed ) ) {
obj = { success : true } ;
return obj ;
}
}
const _Number = Number ;
2026-07-25 08:10:48 +00:00
let obj1 = importAll ( 7958 ) ;
2026-07-23 10:11:24 +00:00
const NumberResult = Number ( obj1 . normalizeNumericString ( _isNativeReflectConstruct . locale , trimmed ) ) ;
2026-07-20 16:05:17 +00:00
if ( null != NumberResult ) {
const _isNaN = isNaN ;
if ( ! isNaN ( NumberResult ) ) {
const _Number2 = Number ;
if ( Number . isInteger ( NumberResult ) ) {
const _Number3 = Number ;
if ( Number . isSafeInteger ( NumberResult ) ) {
2026-07-23 10:11:24 +00:00
let tmp17 = validateNumericOptionRange ( NumberResult , type2 , require ( 1212 ) /* getSystemLocale */ . t [ "8Y5zsp" ] , require ( 1212 ) /* getSystemLocale */ . t . CyRLmH , require ( 1212 ) /* getSystemLocale */ . t [ "VD3Q+S" ] ) ;
2026-07-20 16:05:17 +00:00
}
return tmp17 ;
}
}
}
obj1 = { success : false } ;
tmp17 = obj1 ;
}
}
}
return { success : false } ;
} ,
2026-07-25 08:10:48 +00:00
[ arg1 ( 1882 ) . ApplicationCommandOptionType . NUMBER ] : ( type , type2 , id ) = > {
importDefault ( 44 ) ( type2 . type === require ( 1882 ) /* PermissionOverwriteType */ . ApplicationCommandOptionType . NUMBER , "option type must match validator type" ) ;
2026-07-20 16:05:17 +00:00
let trimmed = null ;
if ( "text" === type . type ) {
trimmed = type . text . trim ( ) ;
const str = type . text ;
}
if ( null != trimmed ) {
if ( 0 !== trimmed . length ) {
if ( null != type2 . choices ) {
2026-07-25 08:10:48 +00:00
let obj = { success : null != require ( 7960 ) /* findChoiceStringValue */ . findChoiceNumberValue ( type2 . choices , trimmed ) } ;
2026-07-20 16:05:17 +00:00
return obj ;
} else {
if ( type2 . autocomplete ) {
2026-07-25 08:10:48 +00:00
obj = require ( 7960 ) /* findChoiceStringValue */ ;
2026-07-20 16:05:17 +00:00
if ( null != obj . findAutocompleteChoiceNumberValue ( id , type2 . name , trimmed ) ) {
obj = { success : true } ;
return obj ;
}
}
const _Number = Number ;
2026-07-25 08:10:48 +00:00
let obj1 = importAll ( 7958 ) ;
2026-07-23 10:11:24 +00:00
const NumberResult = Number ( obj1 . normalizeNumericString ( _isNativeReflectConstruct . locale , trimmed ) ) ;
2026-07-20 16:05:17 +00:00
const _isNaN = isNaN ;
if ( ! isNaN ( NumberResult ) ) {
const _Number2 = Number ;
if ( NumberResult <= Number . MAX_SAFE_INTEGER ) {
const _Number3 = Number ;
if ( NumberResult >= Number . MIN_SAFE_INTEGER ) {
2026-07-23 10:11:24 +00:00
let tmp17 = validateNumericOptionRange ( NumberResult , type2 , require ( 1212 ) /* getSystemLocale */ . t [ "8Y5zsp" ] , require ( 1212 ) /* getSystemLocale */ . t . CyRLmH , require ( 1212 ) /* getSystemLocale */ . t [ "VD3Q+S" ] ) ;
2026-07-20 16:05:17 +00:00
}
return tmp17 ;
}
}
obj1 = { success : false } ;
tmp17 = obj1 ;
}
}
}
return { success : false } ;
} ,
2026-07-25 08:10:48 +00:00
[ arg1 ( 1882 ) . ApplicationCommandOptionType . USER ] : ( type , arg1 , id , source ) = > {
2026-07-20 16:05:17 +00:00
if ( "text" === type . type ) {
2026-07-25 08:10:48 +00:00
let obj1 = require ( 5674 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
if ( obj1 . isSnowflake ( type . text ) ) {
let obj = { success : true } ;
return obj ;
} else {
2026-07-25 08:10:48 +00:00
const obj3 = require ( 7961 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
obj = { allowRoles : false } ;
const applicationCommandOption = obj3 . resolveApplicationCommandOption ( type . text , source , id , obj ) ;
obj1 = { } ;
type = undefined ;
if ( null != applicationCommandOption ) {
type = applicationCommandOption . type ;
}
obj1 . success = "userMention" === type ;
return obj1 ;
}
} else {
obj = { success : "userMention" === type . type } ;
return obj ;
}
} ,
2026-07-25 08:10:48 +00:00
[ arg1 ( 1882 ) . ApplicationCommandOptionType . CHANNEL ] : ( type , arg1 , id , source ) = > {
2026-07-20 16:05:17 +00:00
if ( "text" === type . type ) {
if ( obj2 . isSnowflake ( type . text ) ) {
let obj = { success : true } ;
return obj ;
} else {
2026-07-25 08:10:48 +00:00
const applicationCommandOption = require ( 7961 ) /* _createForOfIteratorHelperLoose */ . resolveApplicationCommandOption ( type . text , source , id ) ;
2026-07-20 16:05:17 +00:00
obj = { } ;
type = undefined ;
if ( null != applicationCommandOption ) {
type = applicationCommandOption . type ;
}
obj . success = "channelMention" === type ;
return obj ;
}
2026-07-25 08:10:48 +00:00
obj2 = require ( 5674 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
} else {
obj = { success : "channelMention" === type . type } ;
return obj ;
}
} ,
2026-07-25 08:10:48 +00:00
[ arg1 ( 1882 ) . ApplicationCommandOptionType . ROLE ] : ( type , arg1 , id , source ) = > {
2026-07-20 16:05:17 +00:00
if ( "text" === type . type ) {
2026-07-25 08:10:48 +00:00
let obj1 = require ( 5674 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
if ( obj1 . isSnowflake ( type . text ) ) {
let obj = { success : true } ;
return obj ;
} else {
2026-07-25 08:10:48 +00:00
const obj3 = require ( 7961 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
obj = { allowUsers : false } ;
const applicationCommandOption = obj3 . resolveApplicationCommandOption ( type . text , source , id , obj ) ;
obj1 = { } ;
type = undefined ;
if ( null != applicationCommandOption ) {
type = applicationCommandOption . type ;
}
obj1 . success = "roleMention" === type ;
return obj1 ;
}
} else {
obj = { success : isValidRoleMention ( type ) } ;
return obj ;
}
} ,
2026-07-25 08:10:48 +00:00
[ arg1 ( 1882 ) . ApplicationCommandOptionType . MENTIONABLE ] : ( type , arg1 , id , source ) = > {
2026-07-20 16:05:17 +00:00
if ( "text" === type . type ) {
if ( obj2 . isSnowflake ( type . text ) ) {
let obj = { success : true } ;
return obj ;
} else {
2026-07-25 08:10:48 +00:00
const applicationCommandOption = require ( 7961 ) /* _createForOfIteratorHelperLoose */ . resolveApplicationCommandOption ( type . text , source , id ) ;
2026-07-20 16:05:17 +00:00
obj = { } ;
let tmp11 = null != applicationCommandOption ;
if ( tmp11 ) {
let tmp12 = "userMention" === applicationCommandOption . type ;
if ( ! tmp12 ) {
tmp12 = isValidRoleMention ( applicationCommandOption ) ;
}
tmp11 = tmp12 ;
}
obj . success = tmp11 ;
return obj ;
}
2026-07-25 08:10:48 +00:00
obj2 = require ( 5674 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
} else {
obj = { } ;
let tmp = "userMention" === type . type ;
if ( ! tmp ) {
tmp = isValidRoleMention ( type ) ;
}
obj . success = tmp ;
return obj ;
}
} ,
2026-07-25 08:10:48 +00:00
[ arg1 ( 1882 ) . ApplicationCommandOptionType . ATTACHMENT ] : ( type , name , arg2 , arg3 , commandOrigin ) = > {
2026-07-20 16:05:17 +00:00
if ( "text" !== type . type ) {
let obj = { success : false } ;
return obj ;
} else {
2026-07-25 08:10:48 +00:00
obj = require ( 5674 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-23 10:11:24 +00:00
upload = upload . getUpload ( arg2 , name . name , obj . getCommandAttachmentDraftType ( commandOrigin ) ) ;
2026-07-20 16:05:17 +00:00
obj = { success : null != upload && upload . filename === type . text } ;
return obj ;
}
}
} ;
2026-07-23 10:11:24 +00:00
const result = require ( "PermissionOverwriteType" ) . fileFinishedImporting ( "modules/application_commands/ApplicationCommandValidators.tsx" ) ;
2026-07-22 07:54:56 +00:00
export default obj ;