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.
- package/bin/{bin.js → cjs/bin.js} +0 -0
- package/bin/{index.js → cjs/index.js} +0 -0
- package/bin/cjs/package.json +3 -0
- package/bin/{reciple → cjs/reciple}/classes/CommandCooldownManager.js +0 -0
- package/bin/{reciple → cjs/reciple}/classes/MessageCommandOptionManager.js +0 -0
- package/bin/{reciple → cjs/reciple}/classes/RecipleClient.js +3 -3
- package/bin/{reciple → cjs/reciple}/classes/RecipleConfig.js +0 -0
- package/bin/{reciple → cjs/reciple}/classes/builders/MessageCommandBuilder.js +2 -3
- package/bin/{reciple → cjs/reciple}/classes/builders/MessageCommandOptionBuilder.js +0 -0
- package/bin/{reciple → cjs/reciple}/classes/builders/SlashCommandBuilder.js +15 -16
- package/bin/{reciple → cjs/reciple}/flags.js +0 -0
- package/bin/{reciple → cjs/reciple}/logger.js +0 -0
- package/bin/{reciple → cjs/reciple}/modules.js +2 -2
- package/bin/{reciple → cjs/reciple}/permissions.js +0 -0
- package/bin/{reciple → cjs/reciple}/registerApplicationCommands.js +0 -0
- package/bin/{reciple → cjs/reciple}/types/builders.js +0 -0
- package/bin/{reciple → cjs/reciple}/types/commands.js +0 -0
- package/bin/{reciple → cjs/reciple}/types/paramOptions.js +0 -0
- package/bin/cjs/reciple/util.js +11 -0
- package/bin/{reciple → cjs/reciple}/version.js +0 -0
- package/bin/mjs/bin.js +46 -0
- package/bin/{index.d.ts → mjs/index.js} +0 -0
- package/bin/mjs/package.json +3 -0
- package/bin/mjs/reciple/classes/CommandCooldownManager.js +87 -0
- package/bin/mjs/reciple/classes/MessageCommandOptionManager.js +21 -0
- package/bin/mjs/reciple/classes/RecipleClient.js +363 -0
- package/bin/mjs/reciple/classes/RecipleConfig.js +92 -0
- package/bin/mjs/reciple/classes/builders/MessageCommandBuilder.js +218 -0
- package/bin/mjs/reciple/classes/builders/MessageCommandOptionBuilder.js +67 -0
- package/bin/mjs/reciple/classes/builders/SlashCommandBuilder.js +204 -0
- package/bin/mjs/reciple/flags.js +28 -0
- package/bin/mjs/reciple/logger.js +28 -0
- package/bin/mjs/reciple/modules.js +81 -0
- package/bin/mjs/reciple/permissions.js +23 -0
- package/bin/mjs/reciple/registerApplicationCommands.js +47 -0
- package/bin/mjs/reciple/types/builders.js +8 -0
- package/bin/mjs/reciple/types/commands.js +12 -0
- package/bin/mjs/reciple/types/paramOptions.js +1 -0
- package/bin/mjs/reciple/util.js +7 -0
- package/bin/mjs/reciple/version.js +38 -0
- package/bin/{bin.d.ts → types/bin.d.ts} +0 -0
- package/bin/types/index.d.ts +17 -0
- package/bin/{reciple → types/reciple}/classes/CommandCooldownManager.d.ts +0 -0
- package/bin/{reciple → types/reciple}/classes/MessageCommandOptionManager.d.ts +0 -0
- package/bin/{reciple → types/reciple}/classes/RecipleClient.d.ts +1 -1
- package/bin/{reciple → types/reciple}/classes/RecipleConfig.d.ts +0 -0
- package/bin/{reciple → types/reciple}/classes/builders/MessageCommandBuilder.d.ts +0 -0
- package/bin/{reciple → types/reciple}/classes/builders/MessageCommandOptionBuilder.d.ts +0 -0
- package/bin/{reciple → types/reciple}/classes/builders/SlashCommandBuilder.d.ts +0 -0
- package/bin/{reciple → types/reciple}/flags.d.ts +0 -0
- package/bin/{reciple → types/reciple}/logger.d.ts +0 -0
- package/bin/{reciple → types/reciple}/modules.d.ts +0 -0
- package/bin/{reciple → types/reciple}/permissions.d.ts +0 -0
- package/bin/{reciple → types/reciple}/registerApplicationCommands.d.ts +0 -0
- package/bin/{reciple → types/reciple}/types/builders.d.ts +30 -34
- package/bin/{reciple → types/reciple}/types/commands.d.ts +0 -0
- package/bin/{reciple → types/reciple}/types/paramOptions.d.ts +0 -0
- package/bin/{reciple → types/reciple}/util.d.ts +0 -0
- package/bin/{reciple → types/reciple}/version.d.ts +0 -0
- package/package.json +15 -8
- 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
|
|
141
|
-
type: ApplicationCommandOptionType.
|
|
142
|
-
minLength?: number;
|
|
143
|
-
maxLength?: number;
|
|
130
|
+
export interface SlashCommandAttachmentOptionData extends Omit<SharedSlashCommandOptionData, "choices" | "autocomplete"> {
|
|
131
|
+
type: ApplicationCommandOptionType.Attachment;
|
|
144
132
|
}
|
|
145
|
-
export interface
|
|
146
|
-
type: ApplicationCommandOptionType.
|
|
147
|
-
|
|
148
|
-
|
|
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
|
|
168
|
-
type: ApplicationCommandOptionType.
|
|
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
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reciple",
|
|
3
|
-
"version": "5.4.
|
|
4
|
-
"bin": "bin/bin.js",
|
|
3
|
+
"version": "5.4.1-pre.2",
|
|
5
4
|
"license": "GPL-3.0",
|
|
6
|
-
"
|
|
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.
|
|
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.
|
|
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.
|
|
75
|
+
"typescript": "^4.8.2"
|
|
69
76
|
},
|
|
70
77
|
"peerDependencies": {
|
|
71
78
|
"discord.js": "^14.2.0"
|
package/bin/reciple/util.js
DELETED
|
@@ -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;
|