reciple 5.0.0-pre.7 → 5.0.0
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 +1 -1
- package/bin/reciple/classes/RecipleClient.d.ts +2 -2
- package/bin/reciple/classes/RecipleClient.js +2 -2
- package/bin/reciple/classes/builders/MessageCommandBuilder.d.ts +3 -5
- package/bin/reciple/classes/builders/SlashCommandBuilder.d.ts +3 -5
- package/bin/reciple/modules.js +1 -1
- package/bin/reciple/types/builders.d.ts +0 -4
- package/bin/reciple/types/commands.d.ts +19 -8
- package/package.json +2 -1
package/bin/bin.js
CHANGED
|
@@ -42,7 +42,7 @@ catch (err) {
|
|
|
42
42
|
const config = configParser.getConfig();
|
|
43
43
|
const client = new RecipleClient_1.RecipleClient(Object.assign({ config: config }, config.client));
|
|
44
44
|
if (config.fileLogging.clientLogs)
|
|
45
|
-
client.logger.info('Reciple
|
|
45
|
+
client.logger.info('Starting Reciple client v' + version_1.rawVersion);
|
|
46
46
|
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
47
|
yield client.startModules((0, discord_js_1.normalizeArray)(config.modulesFolder));
|
|
48
48
|
client.on('ready', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { MessageCommandBuilder, MessageCommandExecuteData } from './builders/MessageCommandBuilder';
|
|
2
2
|
import { SlashCommandBuilder, SlashCommandExecuteData } from './builders/SlashCommandBuilder';
|
|
3
3
|
import { ApplicationCommandBuilder } from '../registerApplicationCommands';
|
|
4
|
-
import {
|
|
4
|
+
import { AnyCommandExecuteData, AnyCommandHaltData } from '../types/commands';
|
|
5
5
|
import { CommandCooldownManager } from './CommandCooldownManager';
|
|
6
|
-
import {
|
|
6
|
+
import { AnyCommandBuilder, CommandBuilderType } from '../types/builders';
|
|
7
7
|
import { RecipleClientAddModuleOptions } from '../types/paramOptions';
|
|
8
8
|
import { Logger as ILogger } from 'fallout-utility';
|
|
9
9
|
import { Config } from './RecipleConfig';
|
|
@@ -16,11 +16,11 @@ exports.RecipleClient = void 0;
|
|
|
16
16
|
const MessageCommandBuilder_1 = require("./builders/MessageCommandBuilder");
|
|
17
17
|
const SlashCommandBuilder_1 = require("./builders/SlashCommandBuilder");
|
|
18
18
|
const registerApplicationCommands_1 = require("../registerApplicationCommands");
|
|
19
|
-
const
|
|
19
|
+
const commands_1 = require("../types/commands");
|
|
20
20
|
const permissions_1 = require("../permissions");
|
|
21
21
|
const CommandCooldownManager_1 = require("./CommandCooldownManager");
|
|
22
22
|
const MessageCommandOptionManager_1 = require("./MessageCommandOptionManager");
|
|
23
|
-
const
|
|
23
|
+
const builders_1 = require("../types/builders");
|
|
24
24
|
const fallout_utility_1 = require("fallout-utility");
|
|
25
25
|
const RecipleConfig_1 = require("./RecipleConfig");
|
|
26
26
|
const modules_1 = require("../modules");
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { CommandBuilderType,
|
|
1
|
+
import { CommandBuilderType, CommandHaltFunction, CommandExecuteFunction, SharedCommandBuilderProperties } from '../../types/builders';
|
|
2
|
+
import { AnyCommandExecuteData, BaseCommandExecuteData, CommandHaltData } from '../../types/commands';
|
|
2
3
|
import { Message, PermissionResolvable, RestOrArray } from 'discord.js';
|
|
3
4
|
import { MessageCommandOptionManager } from '../MessageCommandOptionManager';
|
|
4
5
|
import { MessageCommandOptionBuilder } from './MessageCommandOptionBuilder';
|
|
5
6
|
import { Command as CommandMessage } from 'fallout-utility';
|
|
6
|
-
import { CommandHaltData } from '../../types/commands';
|
|
7
|
-
import { RecipleClient } from '../RecipleClient';
|
|
8
7
|
/**
|
|
9
8
|
* Execute data for message command
|
|
10
9
|
*/
|
|
11
|
-
export interface MessageCommandExecuteData {
|
|
10
|
+
export interface MessageCommandExecuteData extends BaseCommandExecuteData {
|
|
12
11
|
message: Message;
|
|
13
12
|
options: MessageCommandOptionManager;
|
|
14
13
|
command: CommandMessage;
|
|
15
14
|
builder: MessageCommandBuilder;
|
|
16
|
-
client: RecipleClient<true>;
|
|
17
15
|
}
|
|
18
16
|
/**
|
|
19
17
|
* Validated message command option
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { CommandBuilderType,
|
|
2
|
-
import { CommandHaltData } from '../../types/commands';
|
|
3
|
-
import { RecipleClient } from '../RecipleClient';
|
|
1
|
+
import { CommandBuilderType, CommandHaltFunction, CommandExecuteFunction, SharedCommandBuilderProperties } from '../../types/builders';
|
|
2
|
+
import { AnyCommandExecuteData, BaseCommandExecuteData, CommandHaltData } from '../../types/commands';
|
|
4
3
|
import { ChatInputCommandInteraction, PermissionResolvable, RestOrArray, SlashCommandBuilder as DiscordJsSlashCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandsOnlyBuilder as DiscordJsSlashCommandSubcommandsOnlyBuilder } from 'discord.js';
|
|
5
4
|
/**
|
|
6
5
|
* Execute data for slash command
|
|
7
6
|
*/
|
|
8
|
-
export interface SlashCommandExecuteData {
|
|
7
|
+
export interface SlashCommandExecuteData extends BaseCommandExecuteData {
|
|
9
8
|
interaction: ChatInputCommandInteraction;
|
|
10
9
|
builder: SlashCommandBuilder;
|
|
11
|
-
client: RecipleClient<true>;
|
|
12
10
|
}
|
|
13
11
|
/**
|
|
14
12
|
* Slash command halt data
|
package/bin/reciple/modules.js
CHANGED
|
@@ -18,8 +18,8 @@ const discord_js_1 = require("discord.js");
|
|
|
18
18
|
const version_1 = require("./version");
|
|
19
19
|
const fs_1 = require("fs");
|
|
20
20
|
const wildcard_match_1 = __importDefault(require("wildcard-match"));
|
|
21
|
-
const path_1 = __importDefault(require("path"));
|
|
22
21
|
const flags_1 = require("./flags");
|
|
22
|
+
const path_1 = __importDefault(require("path"));
|
|
23
23
|
/**
|
|
24
24
|
* Load modules from folder
|
|
25
25
|
* @param client Reciple client
|
|
@@ -5,10 +5,6 @@ import { Awaitable, PermissionResolvable, RestOrArray } from 'discord.js';
|
|
|
5
5
|
* Any command builders
|
|
6
6
|
*/
|
|
7
7
|
export declare type AnyCommandBuilder = SlashCommandBuilder | MessageCommandBuilder;
|
|
8
|
-
/**
|
|
9
|
-
* Any command execute data
|
|
10
|
-
*/
|
|
11
|
-
export declare type AnyCommandExecuteData = SlashCommandExecuteData | MessageCommandExecuteData;
|
|
12
8
|
/**
|
|
13
9
|
* Any command halt functions
|
|
14
10
|
*/
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { MessageCommandExecuteData, MessageCommandHaltData } from '../classes/builders/MessageCommandBuilder';
|
|
2
2
|
import { SlashCommandExecuteData, SlashCommandHaltData } from '../classes/builders/SlashCommandBuilder';
|
|
3
3
|
import { MessageCommandOptionManager } from '../classes/MessageCommandOptionManager';
|
|
4
|
-
import { CommandBuilderType, AnyCommandExecuteData } from '../types/builders';
|
|
5
4
|
import { CooledDownUser } from '../classes/CommandCooldownManager';
|
|
5
|
+
import { RecipleClient } from '../classes/RecipleClient';
|
|
6
|
+
import { CommandBuilderType } from '../types/builders';
|
|
6
7
|
/**
|
|
7
8
|
* Any command halt data
|
|
8
9
|
*/
|
|
@@ -11,31 +12,41 @@ export declare type AnyCommandHaltData = SlashCommandHaltData | MessageCommandHa
|
|
|
11
12
|
* command halt data
|
|
12
13
|
*/
|
|
13
14
|
export declare type CommandHaltData<T extends CommandBuilderType> = CommandErrorData<T> | CommandCooldownData<T> | (T extends CommandBuilderType.SlashCommand ? never : CommandInvalidArguments<T> | CommandMissingArguments<T>) | CommandMissingMemberPermissions<T> | CommandMissingBotPermissions<T>;
|
|
15
|
+
/**
|
|
16
|
+
* Any command execute data
|
|
17
|
+
*/
|
|
18
|
+
export declare type AnyCommandExecuteData = SlashCommandExecuteData | MessageCommandExecuteData;
|
|
19
|
+
/**
|
|
20
|
+
* Command execute data
|
|
21
|
+
*/
|
|
22
|
+
export interface BaseCommandExecuteData {
|
|
23
|
+
client: RecipleClient<true>;
|
|
24
|
+
}
|
|
14
25
|
/**
|
|
15
26
|
* Command halt reason base
|
|
16
27
|
*/
|
|
17
|
-
export interface
|
|
28
|
+
export interface BaseCommandHaltData<T extends CommandBuilderType> {
|
|
18
29
|
executeData: T extends CommandBuilderType.SlashCommand ? SlashCommandExecuteData : T extends CommandBuilderType.MessageCommand ? MessageCommandExecuteData : AnyCommandExecuteData;
|
|
19
30
|
}
|
|
20
|
-
export interface CommandErrorData<T extends CommandBuilderType> extends
|
|
31
|
+
export interface CommandErrorData<T extends CommandBuilderType> extends BaseCommandHaltData<T> {
|
|
21
32
|
reason: CommandHaltReason.Error;
|
|
22
33
|
error: any;
|
|
23
34
|
}
|
|
24
|
-
export interface CommandCooldownData<T extends CommandBuilderType> extends
|
|
35
|
+
export interface CommandCooldownData<T extends CommandBuilderType> extends BaseCommandHaltData<T>, CooledDownUser {
|
|
25
36
|
reason: CommandHaltReason.Cooldown;
|
|
26
37
|
}
|
|
27
|
-
export interface CommandInvalidArguments<T extends CommandBuilderType> extends
|
|
38
|
+
export interface CommandInvalidArguments<T extends CommandBuilderType> extends BaseCommandHaltData<T> {
|
|
28
39
|
reason: CommandHaltReason.InvalidArguments;
|
|
29
40
|
invalidArguments: MessageCommandOptionManager;
|
|
30
41
|
}
|
|
31
|
-
export interface CommandMissingArguments<T extends CommandBuilderType> extends
|
|
42
|
+
export interface CommandMissingArguments<T extends CommandBuilderType> extends BaseCommandHaltData<T> {
|
|
32
43
|
reason: CommandHaltReason.MissingArguments;
|
|
33
44
|
missingArguments: MessageCommandOptionManager;
|
|
34
45
|
}
|
|
35
|
-
export interface CommandMissingMemberPermissions<T extends CommandBuilderType> extends
|
|
46
|
+
export interface CommandMissingMemberPermissions<T extends CommandBuilderType> extends BaseCommandHaltData<T> {
|
|
36
47
|
reason: CommandHaltReason.MissingMemberPermissions;
|
|
37
48
|
}
|
|
38
|
-
export interface CommandMissingBotPermissions<T extends CommandBuilderType> extends
|
|
49
|
+
export interface CommandMissingBotPermissions<T extends CommandBuilderType> extends BaseCommandHaltData<T> {
|
|
39
50
|
reason: CommandHaltReason.MissingBotPermissions;
|
|
40
51
|
}
|
|
41
52
|
/**
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reciple",
|
|
3
|
-
"version": "5.0.0
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"bin": "bin/bin.js",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "bin/index.js",
|
|
7
|
+
"typings": "bin/index.d.ts",
|
|
7
8
|
"author": "FalloutStudios",
|
|
8
9
|
"description": "Handler for Discord.js",
|
|
9
10
|
"homepage": "https://reciple.js.org",
|