2026-07-25 08:10:48 +00:00
// Module ID: 6037
2026-07-27 11:26:19 +00:00
// Function ID: 54137
2026-07-20 16:05:17 +00:00
// Name: updateOptionStates
2026-07-25 08:10:48 +00:00
// Dependencies: [1194, 6038, 653, 44, 5676, 686, 507, 21, 1882, 2]
2026-07-20 16:05:17 +00:00
// Exports: fetchCommand, fetchCommands, fetchCommandsForApplication, performAutocomplete, setActiveCommand, setAppLauncherActiveCommand, setPreferredCommandId, updateApplicationGuildCommandPermissions, updateChannelState, updateOptionValidationStates, updateRegistry
2026-07-25 08:10:48 +00:00
// Module 6037 (updateOptionStates)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_4 from "_isNativeReflectConstruct" ;
import { Endpoints } from "ME" ;
let require = arg1 ;
2026-07-20 16:05:17 +00:00
function updateOptionStates ( id , changedOptionStates ) {
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 686 ) ;
2026-07-20 16:05:17 +00:00
obj = { type : "APPLICATION_COMMAND_UPDATE_OPTIONS" , channelId : id , changedOptionStates } ;
obj . dispatch ( obj ) ;
}
2026-07-23 10:11:24 +00:00
const result = require ( "ME" ) . fileFinishedImporting ( "modules/application_commands/ApplicationCommandActionCreators.tsx" ) ;
2026-07-20 16:05:17 +00:00
export const setActiveCommand = function setActiveCommand ( command ) {
let _location ;
let channelId ;
let commandOrigin ;
let initialValues ;
let query ;
let queryLength ;
let searchResultsPosition ;
let section ;
let sectionName ;
let source ;
let triggerSection ;
command = command . command ;
( { channelId , section , location : _location , initialValues , triggerSection , queryLength , sectionName , query , searchResultsPosition , source , commandOrigin } = command ) ;
if ( null != command ) {
2026-07-25 08:10:48 +00:00
importDefault ( 44 ) ( command . inputType !== require ( 5676 ) /* ApplicationCommandSectionType */ . ApplicationCommandInputType . PLACEHOLDER , "command should not be placeholder" ) ;
2026-07-23 10:11:24 +00:00
const tmp3 = importDefault ( 44 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
importDefault ( 686 ) . dispatch ( { type : "APPLICATION_COMMAND_SET_ACTIVE_COMMAND" , channelId , command , section , initialValues , location : _location , triggerSection , queryLength , sectionName , query , searchResultsPosition , source , commandOrigin } ) ;
2026-07-20 16:05:17 +00:00
} ;
export const setPreferredCommandId = function setPreferredCommandId ( channelId , commandId ) {
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 686 ) ;
2026-07-20 16:05:17 +00:00
obj = { type : "APPLICATION_COMMAND_SET_PREFERRED_COMMAND" , channelId , commandId } ;
obj . dispatch ( obj ) ;
} ;
export { updateOptionStates } ;
export const updateOptionValidationStates = function updateOptionValidationStates ( id ) {
const entries = Object . entries ( arg1 ) ;
updateOptionStates ( id , Object . fromEntries ( entries . map ( ( arg0 ) = > {
let tmp ;
let tmp2 ;
[ tmp , tmp2 ] = arg0 ;
const items = [ tmp , { lastValidationResult : tmp2 } ] ;
return items ;
} ) ) ) ;
} ;
export const updateChannelState = function updateChannelState ( arg0 ) {
let _location ;
let changedOptionStates ;
let channelId ;
let command ;
let preferredCommandId ;
let section ;
( { channelId , command , section , preferredCommandId , location : _location , changedOptionStates } = arg0 ) ;
2026-07-23 10:11:24 +00:00
importDefault ( 686 ) . dispatch ( { type : "APPLICATION_COMMAND_UPDATE_CHANNEL_STATE" , channelId , command , section , preferredCommandId , location : _location , changedOptionStates } ) ;
2026-07-20 16:05:17 +00:00
} ;
export const updateApplicationGuildCommandPermissions = function updateApplicationGuildCommandPermissions ( arg0 , arg1 , arg2 , permissions ) {
2026-07-23 10:11:24 +00:00
const HTTP = require ( 507 ) /* _isNativeReflectConstruct */ . HTTP ;
obj = { body : obj , url : Endpoints.APPLICATION_BOT_GUILD_COMMAND_PERMISSIONS ( arg0 , arg1 , arg2 ) , rejectWithError : false } ;
2026-07-20 16:05:17 +00:00
obj = { permissions } ;
return HTTP . put ( obj ) ;
} ;
export const performAutocomplete = function performAutocomplete ( command , context , data ) {
let name ;
let query ;
2026-07-23 10:11:24 +00:00
importDefault ( 44 ) ( null != context . autocomplete , "Missing autocomplete context" ) ;
2026-07-20 16:05:17 +00:00
( { query , name } = context . autocomplete ) ;
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 21 ) ;
2026-07-20 16:05:17 +00:00
const fromTimestampResult = obj . fromTimestamp ( Date . now ( ) ) ;
2026-07-23 10:11:24 +00:00
const require = fromTimestampResult ;
2026-07-20 16:05:17 +00:00
if ( null != context . channel ) {
2026-07-23 10:11:24 +00:00
let obj1 = importDefault ( 686 ) ;
2026-07-20 16:05:17 +00:00
obj = { type : "APPLICATION_COMMAND_AUTOCOMPLETE_REQUEST" , nonce : fromTimestampResult , channelId : context.channel.id , query , name } ;
obj1 . dispatch ( obj ) ;
if ( null == autocompleteChoices . getAutocompleteChoices ( context . channel . id , name , query ) ) {
2026-07-23 10:11:24 +00:00
const HTTP = require ( 507 ) /* _isNativeReflectConstruct */ . HTTP ;
2026-07-20 16:05:17 +00:00
obj = { url : Endpoints.INTERACTIONS } ;
2026-07-25 08:10:48 +00:00
obj1 = { type : require ( 1882 ) /* PermissionOverwriteType */ . InteractionTypes . APPLICATION_COMMAND_AUTOCOMPLETE , application_id : command.applicationId } ;
2026-07-20 16:05:17 +00:00
const guild = context . guild ;
let id ;
if ( null != guild ) {
id = guild . id ;
}
obj1 . guild_id = id ;
obj1 . channel_id = context . channel . id ;
obj1 . session_id = sessionId . getSessionId ( ) ;
obj1 . data = data ;
obj1 . nonce = fromTimestampResult ;
obj . body = obj1 ;
obj . timeout = 3000 ;
obj . rejectWithError = true ;
HTTP . post ( obj ) . catch ( ( ) = > {
2026-07-23 10:11:24 +00:00
let obj = outer1_1 ( outer1_2 [ 5 ] ) ;
obj = { type : "INTERACTION_FAILURE" , nonce : closure_0 } ;
2026-07-20 16:05:17 +00:00
obj . dispatch ( obj ) ;
} ) ;
const postResult = HTTP . post ( obj ) ;
}
}
} ;
export const fetchCommand = function fetchCommand ( guildId , channelId , commandId ) {
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 686 ) ;
2026-07-20 16:05:17 +00:00
obj = { type : "APPLICATION_COMMAND_FETCH" , channelId , commandId , guildId } ;
obj . dispatch ( obj ) ;
} ;
export const fetchCommands = function fetchCommands ( guildId , channelId , commandIds ) {
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 686 ) ;
2026-07-20 16:05:17 +00:00
obj = { type : "APPLICATION_COMMANDS_FETCH" , channelId , commandIds , guildId } ;
obj . dispatch ( obj ) ;
} ;
export const fetchCommandsForApplication = function fetchCommandsForApplication ( arg0 ) {
let applicationId ;
let channelId ;
let guildId ;
( { guildId , channelId , applicationId } = arg0 ) ;
2026-07-23 10:11:24 +00:00
importDefault ( 686 ) . dispatch ( { type : "APPLICATION_COMMANDS_FETCH_FOR_APPLICATION" , channelId , guildId , applicationId } ) ;
2026-07-20 16:05:17 +00:00
} ;
export const updateRegistry = function updateRegistry ( commands , applications , channelId ) {
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 686 ) ;
2026-07-20 16:05:17 +00:00
obj = { type : "APPLICATION_COMMAND_REGISTRY_UPDATE" , applications , commands , channelId } ;
obj . dispatch ( obj ) ;
} ;
export const setAppLauncherActiveCommand = function setAppLauncherActiveCommand ( id , command ) {
if ( null != command ) {
2026-07-25 08:10:48 +00:00
importDefault ( 44 ) ( command . inputType !== require ( 5676 ) /* ApplicationCommandSectionType */ . ApplicationCommandInputType . PLACEHOLDER , "command should not be placeholder" ) ;
2026-07-23 10:11:24 +00:00
const tmp3 = importDefault ( 44 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 686 ) ;
2026-07-20 16:05:17 +00:00
obj = { type : "APP_LAUNCHER_SET_ACTIVE_COMMAND" , channelId : id , command } ;
obj . dispatch ( obj ) ;
} ;