import { ApplicationCommandOptionValue , Interaction , InteractionApplicationCommandCallbackData , InteractionResponseType , } from 'slash-commands/dist/src/structures' ; export class StringDictionary < V > { private backing : { [ id ] : V ; } = { } ; public get ( k ) { if ( ! ( k in this . backing ) ) { throw new Error ( `Cannot get key that does not exist in dictionary: ${ k }` ) ; } return this . backing [ k ] ; } public set ( k , v ) { var prev = null ; if ( k in this . backing ) { prev = this . backing [ k ] ; } this . backing [ k ] = v ; return prev ; } public delete ( k ) { if ( ! ( k in this . backing ) ) { throw new Error ( `Cannot delete key that does not exist in dictionary: ${ k }` ) ; } delete this . backing [ k ] ; } } type Context = { originalResp : ( _ : InteractionResponse ) => void ; haveResponded : boolean ; } ; declare global { type InteractionResponse = { type : InteractionResponseType . DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE ; } | { type : InteractionResponseType . CHANNEL_MESSAGE_WITH_SOURCE ; data ? : InteractionApplicationCommandCallbackData ; } ; type InteractionRequest = Interaction & { from : string ; options : Map < string , ApplicationCommandOptionValue > ; } ; type InteractionWithContext = InteractionRequest & { context : Context ; } ; }