Hi all. I am using Sapphire to handle my commands, and I have a precondition that checks if a guild has config related to it in the DB, and creates it if not, and I was wondering if there was any way for me to hold that data in the interaction/context. I tried to attach it to context
public override async chatInputRun( interaction: CommandInteraction, _command: ChatInputCommand, __context: PreconditionContext__,)
public override async chatInputRun( interaction: CommandInteraction, _command: ChatInputCommand, __context: PreconditionContext__,)
and then retrieve it in the
public async ticketsCategory(interaction: ChatInputCommand.Interaction, context: ChatInputCommand.RunContext)
public async ticketsCategory(interaction: ChatInputCommand.Interaction, context: ChatInputCommand.RunContext)
(I am using subcommands in a group, hence it's not called that. It does execute right). Logging the context returns
not sure if it's possible to do what I wanted. Thanks
Solution
there is no built in way to pass data, but you can use anything that's in JavaScript by default such as using a keyed map, object, array, database, etc