reciple 5.4.0-pre.2 → 5.4.1-pre.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 (61) hide show
  1. package/bin/{bin.js → cjs/bin.js} +0 -0
  2. package/bin/{index.js → cjs/index.js} +0 -0
  3. package/bin/cjs/package.json +3 -0
  4. package/bin/{reciple → cjs/reciple}/classes/CommandCooldownManager.js +0 -0
  5. package/bin/{reciple → cjs/reciple}/classes/MessageCommandOptionManager.js +0 -0
  6. package/bin/{reciple → cjs/reciple}/classes/RecipleClient.js +3 -3
  7. package/bin/{reciple → cjs/reciple}/classes/RecipleConfig.js +0 -0
  8. package/bin/{reciple → cjs/reciple}/classes/builders/MessageCommandBuilder.js +2 -3
  9. package/bin/{reciple → cjs/reciple}/classes/builders/MessageCommandOptionBuilder.js +0 -0
  10. package/bin/{reciple → cjs/reciple}/classes/builders/SlashCommandBuilder.js +15 -16
  11. package/bin/{reciple → cjs/reciple}/flags.js +0 -0
  12. package/bin/{reciple → cjs/reciple}/logger.js +0 -0
  13. package/bin/{reciple → cjs/reciple}/modules.js +2 -2
  14. package/bin/{reciple → cjs/reciple}/permissions.js +0 -0
  15. package/bin/{reciple → cjs/reciple}/registerApplicationCommands.js +0 -0
  16. package/bin/{reciple → cjs/reciple}/types/builders.js +0 -0
  17. package/bin/{reciple → cjs/reciple}/types/commands.js +0 -0
  18. package/bin/{reciple → cjs/reciple}/types/paramOptions.js +0 -0
  19. package/bin/cjs/reciple/util.js +11 -0
  20. package/bin/{reciple → cjs/reciple}/version.js +0 -0
  21. package/bin/mjs/bin.js +46 -0
  22. package/bin/{index.d.ts → mjs/index.js} +0 -0
  23. package/bin/mjs/package.json +3 -0
  24. package/bin/mjs/reciple/classes/CommandCooldownManager.js +87 -0
  25. package/bin/mjs/reciple/classes/MessageCommandOptionManager.js +21 -0
  26. package/bin/mjs/reciple/classes/RecipleClient.js +363 -0
  27. package/bin/mjs/reciple/classes/RecipleConfig.js +92 -0
  28. package/bin/mjs/reciple/classes/builders/MessageCommandBuilder.js +218 -0
  29. package/bin/mjs/reciple/classes/builders/MessageCommandOptionBuilder.js +67 -0
  30. package/bin/mjs/reciple/classes/builders/SlashCommandBuilder.js +204 -0
  31. package/bin/mjs/reciple/flags.js +28 -0
  32. package/bin/mjs/reciple/logger.js +28 -0
  33. package/bin/mjs/reciple/modules.js +81 -0
  34. package/bin/mjs/reciple/permissions.js +23 -0
  35. package/bin/mjs/reciple/registerApplicationCommands.js +47 -0
  36. package/bin/mjs/reciple/types/builders.js +8 -0
  37. package/bin/mjs/reciple/types/commands.js +12 -0
  38. package/bin/mjs/reciple/types/paramOptions.js +1 -0
  39. package/bin/mjs/reciple/util.js +7 -0
  40. package/bin/mjs/reciple/version.js +38 -0
  41. package/bin/{bin.d.ts → types/bin.d.ts} +0 -0
  42. package/bin/types/index.d.ts +17 -0
  43. package/bin/{reciple → types/reciple}/classes/CommandCooldownManager.d.ts +0 -0
  44. package/bin/{reciple → types/reciple}/classes/MessageCommandOptionManager.d.ts +0 -0
  45. package/bin/{reciple → types/reciple}/classes/RecipleClient.d.ts +1 -1
  46. package/bin/{reciple → types/reciple}/classes/RecipleConfig.d.ts +0 -0
  47. package/bin/{reciple → types/reciple}/classes/builders/MessageCommandBuilder.d.ts +0 -0
  48. package/bin/{reciple → types/reciple}/classes/builders/MessageCommandOptionBuilder.d.ts +0 -0
  49. package/bin/{reciple → types/reciple}/classes/builders/SlashCommandBuilder.d.ts +0 -0
  50. package/bin/{reciple → types/reciple}/flags.d.ts +0 -0
  51. package/bin/{reciple → types/reciple}/logger.d.ts +0 -0
  52. package/bin/{reciple → types/reciple}/modules.d.ts +0 -0
  53. package/bin/{reciple → types/reciple}/permissions.d.ts +0 -0
  54. package/bin/{reciple → types/reciple}/registerApplicationCommands.d.ts +0 -0
  55. package/bin/{reciple → types/reciple}/types/builders.d.ts +30 -34
  56. package/bin/{reciple → types/reciple}/types/commands.d.ts +0 -0
  57. package/bin/{reciple → types/reciple}/types/paramOptions.d.ts +0 -0
  58. package/bin/{reciple → types/reciple}/util.d.ts +0 -0
  59. package/bin/{reciple → types/reciple}/version.d.ts +0 -0
  60. package/package.json +15 -8
  61. package/bin/reciple/util.js +0 -11
@@ -1,6 +1,6 @@
1
- import { MessageCommandBuilder, MessageCommandExecuteData, MessageCommandExecuteFunction, MessageCommandHaltData, MessageCommandHaltFunction } from '../classes/builders/MessageCommandBuilder';
2
- import { SlashCommandBuilder, SlashCommandExecuteData, SlashCommandExecuteFunction, SlashCommandHaltData, SlashCommandHaltFunction, SlashCommandOptionsOnlyBuilder, SlashCommandSubcommandsOnlyBuilder } from '../classes/builders/SlashCommandBuilder';
3
1
  import { ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionType, Awaitable, LocalizationMap, PermissionResolvable, RestOrArray, SlashCommandAttachmentOption, SlashCommandBooleanOption, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandUserOption } from 'discord.js';
2
+ import { SlashCommandBuilder, SlashCommandExecuteData, SlashCommandExecuteFunction, SlashCommandHaltData, SlashCommandHaltFunction, SlashCommandOptionsOnlyBuilder, SlashCommandSubcommandsOnlyBuilder } from '../classes/builders/SlashCommandBuilder';
3
+ import { MessageCommandBuilder, MessageCommandExecuteData, MessageCommandExecuteFunction, MessageCommandHaltData, MessageCommandHaltFunction } from '../classes/builders/MessageCommandBuilder';
4
4
  import { MessageCommandOptionBuilder } from '../classes/builders/MessageCommandOptionBuilder';
5
5
  /**
6
6
  * Any command builders
@@ -119,66 +119,59 @@ export interface SlashCommandData extends SharedCommandDataProperties, Partial<O
119
119
  execute: SlashCommandExecuteFunction;
120
120
  }
121
121
  export interface SharedSlashCommandOptionData<V = string | number> extends SharedCommandDataProperties, Pick<SlashCommandData, "nameLocalizations" | "descriptionLocalizations"> {
122
- /**
123
- * Option choices
124
- */
125
122
  choices?: {
126
123
  name: string;
127
124
  nameLocalizations?: LocalizationMap;
128
125
  value: V;
129
126
  }[];
130
- /**
131
- * Enable autocomplete
132
- */
133
127
  autocomplete?: boolean;
134
- /**
135
- * Is required
136
- * @default false
137
- */
138
128
  required?: boolean;
139
129
  }
140
- export interface SlashCommandStringOptionData extends SharedSlashCommandOptionData<string> {
141
- type: ApplicationCommandOptionType.String;
142
- minLength?: number;
143
- maxLength?: number;
130
+ export interface SlashCommandAttachmentOptionData extends Omit<SharedSlashCommandOptionData, "choices" | "autocomplete"> {
131
+ type: ApplicationCommandOptionType.Attachment;
144
132
  }
145
- export interface SlashCommandNumberOptionData extends SharedSlashCommandOptionData<number> {
146
- type: ApplicationCommandOptionType.Number;
147
- minValue?: number;
148
- maxValue?: number;
133
+ export interface SlashCommandBooleanOptionData extends Omit<SharedSlashCommandOptionData, "choices" | "autocomplete"> {
134
+ type: ApplicationCommandOptionType.Boolean;
135
+ }
136
+ export interface SlashCommandChannelOptionData extends Omit<SharedSlashCommandOptionData, "choices" | "autocomplete"> {
137
+ type: ApplicationCommandOptionType.Channel;
138
+ channelTypes?: ApplicationCommandOptionAllowedChannelTypes[];
149
139
  }
150
140
  export interface SlashCommandIntegerOptionData extends SharedSlashCommandOptionData<number> {
151
141
  type: ApplicationCommandOptionType.Integer;
152
142
  minValue?: number;
153
143
  maxValue?: number;
154
144
  }
155
- export interface SlashCommandBooleanOptionData extends Omit<SharedSlashCommandOptionData, "choices" | "autocomplete"> {
156
- type: ApplicationCommandOptionType.Boolean;
157
- }
158
145
  export interface SlashCommandMentionableOptionData extends Omit<SharedSlashCommandOptionData, "choices" | "autocomplete"> {
159
146
  type: ApplicationCommandOptionType.Mentionable;
160
147
  }
148
+ export interface SlashCommandNumberOptionData extends SharedSlashCommandOptionData<number> {
149
+ type: ApplicationCommandOptionType.Number;
150
+ minValue?: number;
151
+ maxValue?: number;
152
+ }
161
153
  export interface SlashCommandRoleOptionData extends Omit<SharedSlashCommandOptionData, "choices" | "autocomplete"> {
162
154
  type: ApplicationCommandOptionType.Role;
163
155
  }
156
+ export interface SlashCommandStringOptionData extends SharedSlashCommandOptionData<string> {
157
+ type: ApplicationCommandOptionType.String;
158
+ minLength?: number;
159
+ maxLength?: number;
160
+ }
164
161
  export interface SlashCommandUserOptionData extends Omit<SharedSlashCommandOptionData, "choices" | "autocomplete"> {
165
162
  type: ApplicationCommandOptionType.User;
166
163
  }
167
- export interface SlashCommandAttachmentOptionData extends Omit<SharedSlashCommandOptionData, "choices" | "autocomplete"> {
168
- type: ApplicationCommandOptionType.Attachment;
169
- }
170
- export interface SlashCommandChannelOptionData extends Omit<SharedSlashCommandOptionData, "choices" | "autocomplete"> {
171
- type: ApplicationCommandOptionType.Channel;
172
- channelTypes?: ApplicationCommandOptionAllowedChannelTypes[];
164
+ export interface SlashCommandSubCommandData extends SharedCommandDataProperties, Pick<SlashCommandData, "nameLocalizations" | "descriptionLocalizations"> {
165
+ type: ApplicationCommandOptionType.Subcommand;
166
+ options: (AnySlashCommandOptionsOnlyOptionData | AnySlashCommandOptionsOnlyOptionBuilder)[];
173
167
  }
174
168
  export interface SlashCommandSubCommandGroupData extends SharedCommandDataProperties, Pick<SlashCommandData, "nameLocalizations" | "descriptionLocalizations"> {
175
169
  type: ApplicationCommandOptionType.SubcommandGroup;
176
170
  options: (SlashCommandSubCommandData | SlashCommandSubcommandBuilder)[];
177
171
  }
178
- export interface SlashCommandSubCommandData extends SharedCommandDataProperties, Pick<SlashCommandData, "nameLocalizations" | "descriptionLocalizations"> {
179
- type: ApplicationCommandOptionType.Subcommand;
180
- options: (AnySlashCommandOptionsOnlyOptionData | AnySlashCommandOptionsOnlyOptionBuilder)[];
181
- }
172
+ /**
173
+ * Message command object data interface
174
+ */
182
175
  export interface MessageCommandData extends SharedCommandDataProperties, Partial<Omit<SharedCommandBuilderProperties, "setCooldown" | "setRequiredBotPermissions" | "setRequiredMemberPermissions" | "setHalt" | "setExecute" | "halt" | "execute">> {
183
176
  type: CommandBuilderType.MessageCommand;
184
177
  aliases?: string[];
@@ -187,8 +180,11 @@ export interface MessageCommandData extends SharedCommandDataProperties, Partial
187
180
  allowExecuteByBots?: boolean;
188
181
  halt?: MessageCommandHaltFunction;
189
182
  execute: MessageCommandExecuteFunction;
190
- options: MessageCommandOptionResolvable[];
183
+ options?: MessageCommandOptionResolvable[];
191
184
  }
185
+ /**
186
+ * Message command option object data interface
187
+ */
192
188
  export interface MessageCommandOptionData extends SharedCommandDataProperties {
193
189
  name: string;
194
190
  description: string;
File without changes
File without changes
package/package.json CHANGED
@@ -1,13 +1,20 @@
1
1
  {
2
2
  "name": "reciple",
3
- "version": "5.4.0-pre.2",
4
- "bin": "bin/bin.js",
3
+ "version": "5.4.1-pre.2",
5
4
  "license": "GPL-3.0",
6
- "main": "bin/index.js",
7
- "typings": "bin/index.d.ts",
5
+ "typings": "bin/types/index.d.ts",
8
6
  "author": "FalloutStudios",
9
7
  "description": "Handler for Discord.js",
10
8
  "homepage": "https://reciple.js.org",
9
+ "main": "./bin/cjs/index.js",
10
+ "module": "./bin/mjs/index.js",
11
+ "bin": {
12
+ "reciple": "./bin/cjs/bin.js"
13
+ },
14
+ "exports": {
15
+ "import": "./bin/mjs/index.js",
16
+ "require": "./bin/cjs/index.js"
17
+ },
11
18
  "keywords": [
12
19
  "Discord",
13
20
  "Discord.js handler",
@@ -21,7 +28,7 @@
21
28
  },
22
29
  "scripts": {
23
30
  "clean": "yarn exec rimraf bin",
24
- "build": "yarn clean && yarn exec tsc",
31
+ "build": "yarn clean && echo Building commonjs && yarn exec tsc -p ./tsconfigs/tsconfig-cjs.json && echo Building mjs && yarn exec tsc -p ./tsconfigs/tsconfig-mjs.json && node ./tsconfigs/package.json.js",
25
32
  "build:publish": "yarn build && yarn npm publish && yarn build:docs && yarn publish:docs",
26
33
  "build:publish-prerelease": "yarn build && yarn npm publish --tag pre",
27
34
  "build:docs": "yarn exec typedoc --tsconfig ./docs/typedoc.json",
@@ -57,15 +64,15 @@
57
64
  "yaml": "^2.1.1"
58
65
  },
59
66
  "devDependencies": {
60
- "@types/node": "^18.7.9",
67
+ "@types/node": "^18.7.13",
61
68
  "@types/semver": "^7.3.12",
62
69
  "discord.js": "^14.3.0",
63
70
  "rimraf": "^3.0.2",
64
- "typedoc": "^0.23.10",
71
+ "typedoc": "^0.23.11",
65
72
  "typedoc-plugin-discord-types": "^1.0.2",
66
73
  "typedoc-plugin-djs-links": "^1.2.0",
67
74
  "typedoc-plugin-mdn-links": "^2.0.0",
68
- "typescript": "^4.7.4"
75
+ "typescript": "^4.8.2"
69
76
  },
70
77
  "peerDependencies": {
71
78
  "discord.js": "^14.2.0"
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isClass = void 0;
4
- function isClass(object) {
5
- const isCtorClass = object.constructor && object.constructor.toString().substring(0, 5) === 'class';
6
- if (object.prototype === undefined)
7
- return isCtorClass;
8
- const isPrototypeCtorClass = object.prototype.constructor && object.prototype.constructor.toString && object.prototype.constructor.toString().substring(0, 5) === 'class';
9
- return isCtorClass || isPrototypeCtorClass;
10
- }
11
- exports.isClass = isClass;