@ezzi/base 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -130,7 +130,7 @@ declare class GroupCommandModule<Type, Contexts extends readonly InteractionCont
130
130
  constructor(command: Command<Type, Contexts, Return>, data: SubCommandGroupModuleData<Contexts, Return, ModuleReturn>);
131
131
  subcommand(data: SubCommandModuleData<Contexts, ModuleReturn>): this;
132
132
  }
133
- export declare class Command<Type, Contexts extends readonly InteractionContextType[], Return = unknown> {
133
+ export declare class Command<Type, Contexts extends readonly InteractionContextType[] = readonly InteractionContextType[], Return = unknown> {
134
134
  readonly modules: CommandModule[];
135
135
  readonly data: AppCommandData<Type, Contexts, Return>;
136
136
  constructor(data: AppCommandData<Type, Contexts, Return>);
@@ -37,9 +37,7 @@ class Command {
37
37
  this.data.name = this.data.name.slice(0, 32);
38
38
  }
39
39
  if (!this.data.contexts) {
40
- Object.assign(this.data, {
41
- contexts: [InteractionContextType.Guild]
42
- });
40
+ this.data.contexts = [InteractionContextType.Guild];
43
41
  }
44
42
  }
45
43
  group(data) {
@@ -1,4 +1,4 @@
1
- import { ApplicationCommandType, type CacheType, type ClientEvents, type PermissionResolvable } from "discord.js";
1
+ import { ApplicationCommandType, InteractionContextType, type CacheType, type ClientEvents, type PermissionResolvable } from "discord.js";
2
2
  import { type BaseCommandsConfig, type BaseEventsConfig, type BaseRespondersConfig } from "../app.js";
3
3
  import { type AppCommandData, type CommandType } from "./commands/command.js";
4
4
  import { type EventData } from "./events/event.js";
@@ -19,7 +19,7 @@ export interface SetupCreatorsOptions {
19
19
  * functions used to create each type of component.
20
20
  */
21
21
  export declare function setupCreators(options?: SetupCreatorsOptions): {
22
- createCommand<T extends CommandType = ApplicationCommandType.ChatInput, P extends boolean = false, R = void>(data: AppCommandData<T, P, R>): any;
22
+ createCommand<T extends CommandType = ApplicationCommandType.ChatInput, Contexts extends readonly InteractionContextType[] = readonly InteractionContextType[], R = void>(data: AppCommandData<T, Contexts, R>): any;
23
23
  createEvent<EventName extends keyof ClientEvents>(data: EventData<EventName>): void;
24
24
  createResponder<Path extends string, const Types extends readonly ResponderType[], Schema, Cache extends CacheType = CacheType>(data: ResponderData<Path, Types, Schema, Cache>): Responder<string, readonly ResponderType[], unknown, CacheType>;
25
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezzi/base",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Library with structures and functions for creating modern Discord applications.",
5
5
  "license": "MIT",
6
6
  "type": "module",