import { ApplicationCommandInteractionDataOption , ApplicationCommandOptionValue , Interaction , } from 'slash-commands/dist/src/structures' ; function fixArguments ( options , result ) { if ( options === undefined ) { return result ; } for ( const option of options ) { if ( ! ( 'value' in option ) ) { fixArguments ( option . options , result ) ; continue ; } result . set ( option . name , option . value ) ; } return result ; } export function transformRequest ( interaction , from ) { const optionsDict = new Map ( ) ; return { ... interaction , from : from , options : fixArguments ( interaction . data === undefined ? [ ] : interaction . data . options === undefined ? [ ] : interaction . data . options , optionsDict ) , } ; }