@hyperneutrino/djs-lite 1.2.0 → 1.2.2

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.
Files changed (2) hide show
  1. package/index.ts +3 -3
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -31,7 +31,7 @@ process.on("uncaughtException", (err) => console.error(err));
31
31
 
32
32
  type Handler<T extends CommandInteraction | AutocompleteInteraction | MessageComponentInteraction | ModalSubmitInteraction> = (
33
33
  interaction: T,
34
- ...args: any[]
34
+ ...args: T extends MessageComponentInteraction | ModalSubmitInteraction ? (string | undefined)[] : []
35
35
  ) => Awaitable<unknown>;
36
36
 
37
37
  abstract class Command<T extends BaseApplicationCommandData, U extends CommandInteraction, Z extends boolean = false> {
@@ -134,7 +134,7 @@ export async function loadCommands(client: Client<true>, directory: string, guil
134
134
  }
135
135
  }
136
136
 
137
- export async function loadInteractions(client: Client<true>, directory: string, argumentSeparator: string = ":") {
137
+ export async function loadInteractions(client: Client, directory: string, argumentSeparator: string = ":") {
138
138
  const files = await fs.readdir(path.resolve(directory), { recursive: true, withFileTypes: true });
139
139
 
140
140
  const modalHandlers = new Map<string, Handler<ModalSubmitInteraction>>();
@@ -182,7 +182,7 @@ export async function loadInteractions(client: Client<true>, directory: string,
182
182
  });
183
183
  }
184
184
 
185
- export async function loadEvents(client: Client<true>, directory: string, recursive: boolean = false) {
185
+ export async function loadEvents(client: Client, directory: string, recursive: boolean = false) {
186
186
  const files = await fs.readdir(path.resolve(directory), { recursive, withFileTypes: true });
187
187
  const handlers: Partial<{ [K in keyof ClientEvents]: ((...args: ClientEvents[K]) => unknown)[] }> = {};
188
188
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hyperneutrino/djs-lite",
3
3
  "private": false,
4
- "version": "1.2.0",
4
+ "version": "1.2.2",
5
5
  "module": "index.ts",
6
6
  "type": "module",
7
7
  "devDependencies": {