3
3
Awaitable ,
4
4
ChatInputCommandInteraction ,
5
5
Client ,
6
+ Collection ,
6
7
Guild ,
7
8
Interaction ,
8
9
Locale ,
@@ -64,7 +65,7 @@ export interface ContextParameters<
64
65
message : T extends 'message' ? Message : never ;
65
66
forwarded ?: boolean ;
66
67
messageCommandParser ?: T extends 'message' ? MessageCommandParser : never ;
67
- store ?: Map < string , any > ;
68
+ store ?: Collection < string , any > ;
68
69
customArgs ?: Args ;
69
70
}
70
71
@@ -244,7 +245,7 @@ export class Context<
244
245
* @private
245
246
* @internal
246
247
*/
247
- #store: Map < string , any > ;
248
+ #store: Collection < any , any > ;
248
249
249
250
/**
250
251
* @private
@@ -265,7 +266,7 @@ export class Context<
265
266
this . interaction = config . interaction ;
266
267
this . message = config . message ;
267
268
this . client = commandkit . client ;
268
- this . #store = config . store ?? new Map ( ) ;
269
+ this . #store = config . environment ?. store ?? config . store ?? new Collection ( ) ;
269
270
this . command = config . command ;
270
271
271
272
if ( config . interaction ) {
@@ -292,7 +293,7 @@ export class Context<
292
293
* This store is shared across all contexts in the same command execution, including the cloned contexts and middleware contexts.
293
294
*/
294
295
public get store ( ) {
295
- return this . #store;
296
+ return this . config . environment ?. store ?? this . #store;
296
297
}
297
298
298
299
/**
0 commit comments