bakit 1.0.0-beta.7 → 1.0.0-beta.8

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.
@@ -145,7 +145,7 @@ declare const Arg: {
145
145
  };
146
146
 
147
147
  declare namespace CommandAPI {
148
- function use(command: RootCommandEntry): (target: ConstructorLike) => void;
148
+ function use(root: RootCommandEntry): (target: ConstructorLike) => void;
149
149
  function getRoot(constructor: ConstructorLike): RootCommandEntry | undefined;
150
150
  }
151
151
  declare function CommandFactory(options: CreateCommandOptions<BaseCommandEntryOptions> | string): RootCommandEntry;
@@ -1,3 +1,3 @@
1
- export { A as Arg, h as ArgumentOptions, f as ArgumentType, g as BaseArgumentOptions, m as BaseCommandEntry, k as BaseCommandEntryOptions, n as BaseCommandGroupEntry, x as BaseContext, y as ChatInputContext, u as ChatInputContextSendOptions, s as Command, q as CommandAPI, r as CommandFactory, o as CommandGroupEntry, j as CommandHook, t as CommandRegistry, D as Context, w as ContextSendOptions, l as CreateCommandOptions, E as ErrorCommandHookMethod, I as IntegerArgumentOptions, i as MainCommandHookMethod, M as MemberArgumentOptions, z as MessageContext, v as MessageContextSendOptions, N as NumberArgumentOptions, R as RootCommandEntry, S as StringArgumentOptions, p as SubcommandEntry, U as UserArgumentOptions } from '../BakitClient-CU9viQZL.js';
1
+ export { A as Arg, h as ArgumentOptions, f as ArgumentType, g as BaseArgumentOptions, m as BaseCommandEntry, k as BaseCommandEntryOptions, n as BaseCommandGroupEntry, x as BaseContext, y as ChatInputContext, u as ChatInputContextSendOptions, s as Command, q as CommandAPI, r as CommandFactory, o as CommandGroupEntry, j as CommandHook, t as CommandRegistry, D as Context, w as ContextSendOptions, l as CreateCommandOptions, E as ErrorCommandHookMethod, I as IntegerArgumentOptions, i as MainCommandHookMethod, M as MemberArgumentOptions, z as MessageContext, v as MessageContextSendOptions, N as NumberArgumentOptions, R as RootCommandEntry, S as StringArgumentOptions, p as SubcommandEntry, U as UserArgumentOptions } from '../BakitClient-D9kRvFS3.js';
2
2
  import 'discord.js';
3
3
  import 'type-fest';
@@ -1,6 +1,3 @@
1
- // src/command/index.ts
2
- import "reflect-metadata";
3
-
4
1
  // src/command/argument/Argument.ts
5
2
  var ArgumentType = /* @__PURE__ */ ((ArgumentType2) => {
6
3
  ArgumentType2["String"] = "string";
@@ -202,16 +199,16 @@ var SubcommandEntry = class extends BaseCommandEntry {
202
199
  // src/command/Command.ts
203
200
  var CommandAPI;
204
201
  ((CommandAPI2) => {
205
- const ROOT_KEY = Symbol("root");
206
- function use(command) {
202
+ const rootEntries = /* @__PURE__ */ new WeakMap();
203
+ function use(root) {
207
204
  return (target) => {
208
- command.setTarget(target);
209
- Reflect.defineMetadata(ROOT_KEY, command, target);
205
+ root.setTarget(target);
206
+ rootEntries.set(target, root);
210
207
  };
211
208
  }
212
209
  CommandAPI2.use = use;
213
210
  function getRoot(constructor) {
214
- return Reflect.getMetadata(ROOT_KEY, constructor);
211
+ return rootEntries.get(constructor);
215
212
  }
216
213
  CommandAPI2.getRoot = getRoot;
217
214
  })(CommandAPI || (CommandAPI = {}));
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as BaseEntry, C as ConstructorLike, a as BaseHook, b as BaseMainHookMethod, c as BaseErrorHookMethod, d as BakitClient } from './BakitClient-CU9viQZL.js';
2
- export { A as Arg, h as ArgumentOptions, f as ArgumentType, e as BakitClientOptions, g as BaseArgumentOptions, m as BaseCommandEntry, k as BaseCommandEntryOptions, n as BaseCommandGroupEntry, x as BaseContext, y as ChatInputContext, u as ChatInputContextSendOptions, s as Command, q as CommandAPI, r as CommandFactory, o as CommandGroupEntry, j as CommandHook, t as CommandRegistry, J as CommandSyntaxError, H as CommandSyntaxErrorOptions, F as CommandSyntaxErrorType, D as Context, w as ContextSendOptions, l as CreateCommandOptions, E as ErrorCommandHookMethod, G as GetSyntaxErrorMessageFunction, I as IntegerArgumentOptions, i as MainCommandHookMethod, M as MemberArgumentOptions, z as MessageContext, v as MessageContextSendOptions, N as NumberArgumentOptions, R as RootCommandEntry, S as StringArgumentOptions, p as SubcommandEntry, U as UserArgumentOptions } from './BakitClient-CU9viQZL.js';
1
+ import { B as BaseEntry, C as ConstructorLike, a as BaseHook, b as BaseMainHookMethod, c as BaseErrorHookMethod, d as BakitClient } from './BakitClient-D9kRvFS3.js';
2
+ export { A as Arg, h as ArgumentOptions, f as ArgumentType, e as BakitClientOptions, g as BaseArgumentOptions, m as BaseCommandEntry, k as BaseCommandEntryOptions, n as BaseCommandGroupEntry, x as BaseContext, y as ChatInputContext, u as ChatInputContextSendOptions, s as Command, q as CommandAPI, r as CommandFactory, o as CommandGroupEntry, j as CommandHook, t as CommandRegistry, J as CommandSyntaxError, H as CommandSyntaxErrorOptions, F as CommandSyntaxErrorType, D as Context, w as ContextSendOptions, l as CreateCommandOptions, E as ErrorCommandHookMethod, G as GetSyntaxErrorMessageFunction, I as IntegerArgumentOptions, i as MainCommandHookMethod, M as MemberArgumentOptions, z as MessageContext, v as MessageContextSendOptions, N as NumberArgumentOptions, R as RootCommandEntry, S as StringArgumentOptions, p as SubcommandEntry, U as UserArgumentOptions } from './BakitClient-D9kRvFS3.js';
3
3
  import { AsyncLocalStorage } from 'node:async_hooks';
4
4
  import { ClientEvents } from 'discord.js';
5
5
  import EventEmitter from 'node:events';
package/dist/index.js CHANGED
@@ -1,3 +1,6 @@
1
+ // src/index.ts
2
+ import "reflect-metadata";
3
+
1
4
  // src/BakitClient.ts
2
5
  import {
3
6
  Client,
@@ -113,16 +116,16 @@ var SubcommandEntry = class extends BaseCommandEntry {
113
116
  // src/command/Command.ts
114
117
  var CommandAPI;
115
118
  ((CommandAPI2) => {
116
- const ROOT_KEY = Symbol("root");
117
- function use(command) {
119
+ const rootEntries = /* @__PURE__ */ new WeakMap();
120
+ function use(root) {
118
121
  return (target) => {
119
- command.setTarget(target);
120
- Reflect.defineMetadata(ROOT_KEY, command, target);
122
+ root.setTarget(target);
123
+ rootEntries.set(target, root);
121
124
  };
122
125
  }
123
126
  CommandAPI2.use = use;
124
127
  function getRoot(constructor) {
125
- return Reflect.getMetadata(ROOT_KEY, constructor);
128
+ return rootEntries.get(constructor);
126
129
  }
127
130
  CommandAPI2.getRoot = getRoot;
128
131
  })(CommandAPI || (CommandAPI = {}));
@@ -387,9 +390,6 @@ var CommandRegistry = class _CommandRegistry {
387
390
  }
388
391
  };
389
392
 
390
- // src/command/index.ts
391
- import "reflect-metadata";
392
-
393
393
  // src/command/Context.ts
394
394
  import {
395
395
  ChatInputCommandInteraction,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bakit",
3
- "version": "1.0.0-beta.7",
3
+ "version": "1.0.0-beta.8",
4
4
  "description": "A framework for discord.js",
5
5
  "type": "module",
6
6
  "exports": {