reciple 3.0.2 → 3.0.3
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 +3 -3
- package/bin/reciple/classes/RecipleClient.d.ts +4 -4
- package/bin/reciple/classes/RecipleClient.js +7 -7
- package/bin/reciple/classes/RecipleConfig.js +2 -2
- package/bin/reciple/classes/builders/InteractionCommandBuilder.d.ts +7 -3
- package/bin/reciple/classes/builders/InteractionCommandBuilder.js +11 -4
- package/bin/reciple/classes/builders/MessageCommandBuilder.d.ts +5 -5
- package/bin/reciple/classes/builders/MessageCommandBuilder.js +2 -2
- package/bin/reciple/logger.js +1 -1
- package/bin/reciple/modules.d.ts +1 -1
- package/bin/reciple/modules.js +2 -2
- package/bin/reciple/permissions.d.ts +2 -2
- package/bin/reciple/registerInteractionCommands.d.ts +1 -1
- package/bin/reciple/types/commands.d.ts +1 -1
- package/bin/reciple/types/paramOptions.d.ts +2 -2
- package/package.json +1 -1
package/bin/bin.js
CHANGED
|
@@ -11,12 +11,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
};
|
|
12
12
|
var _a, _b;
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
const RecipleConfig_1 = require("./reciple/classes/RecipleConfig");
|
|
15
14
|
const RecipleClient_1 = require("./reciple/classes/RecipleClient");
|
|
16
|
-
const
|
|
17
|
-
const version_1 = require("./reciple/version");
|
|
15
|
+
const RecipleConfig_1 = require("./reciple/classes/RecipleConfig");
|
|
18
16
|
const flags_1 = require("./reciple/flags");
|
|
17
|
+
const version_1 = require("./reciple/version");
|
|
19
18
|
const fallout_utility_1 = require("fallout-utility");
|
|
19
|
+
const fs_1 = require("fs");
|
|
20
20
|
require("dotenv/config");
|
|
21
21
|
if (flags_1.flags.version) {
|
|
22
22
|
console.log(`v${version_1.version}`);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { RecipleModule } from '../modules';
|
|
2
|
+
import { InteractionBuilder } from '../registerInteractionCommands';
|
|
1
3
|
import { RecipleCommandBuilders, RecipleCommandBuilderType } from '../types/builders';
|
|
4
|
+
import { AddModuleOptions } from '../types/paramOptions';
|
|
2
5
|
import { InteractionCommandBuilder, RecipleInteractionCommandExecuteData } from './builders/InteractionCommandBuilder';
|
|
3
6
|
import { MessageCommandBuilder, RecipleMessageCommandExecuteData } from './builders/MessageCommandBuilder';
|
|
4
|
-
import { InteractionBuilder } from '../registerInteractionCommands';
|
|
5
7
|
import { CommandCooldownManager } from './CommandCooldownManager';
|
|
6
|
-
import { Logger as ILogger } from 'fallout-utility';
|
|
7
|
-
import { AddModuleOptions } from '../types/paramOptions';
|
|
8
|
-
import { RecipleModule } from '../modules';
|
|
9
8
|
import { Config } from './RecipleConfig';
|
|
10
9
|
import { ApplicationCommandData, Awaitable, Client, ClientEvents, ClientOptions, CommandInteraction, Interaction, Message } from 'discord.js';
|
|
10
|
+
import { Logger as ILogger } from 'fallout-utility';
|
|
11
11
|
export interface RecipleClientOptions extends ClientOptions {
|
|
12
12
|
config?: Config;
|
|
13
13
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Not cool code
|
|
3
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -11,18 +10,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
10
|
};
|
|
12
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
12
|
exports.RecipleClient = void 0;
|
|
14
|
-
|
|
13
|
+
// Not cool code
|
|
14
|
+
const logger_1 = require("../logger");
|
|
15
|
+
const modules_1 = require("../modules");
|
|
15
16
|
const permissions_1 = require("../permissions");
|
|
16
17
|
const registerInteractionCommands_1 = require("../registerInteractionCommands");
|
|
18
|
+
const builders_1 = require("../types/builders");
|
|
19
|
+
const commands_1 = require("../types/commands");
|
|
20
|
+
const version_1 = require("../version");
|
|
17
21
|
const CommandCooldownManager_1 = require("./CommandCooldownManager");
|
|
18
22
|
const MessageCommandOptionManager_1 = require("./MessageCommandOptionManager");
|
|
19
|
-
const fallout_utility_1 = require("fallout-utility");
|
|
20
|
-
const commands_1 = require("../types/commands");
|
|
21
|
-
const modules_1 = require("../modules");
|
|
22
23
|
const RecipleConfig_1 = require("./RecipleConfig");
|
|
23
|
-
const version_1 = require("../version");
|
|
24
|
-
const logger_1 = require("../logger");
|
|
25
24
|
const discord_js_1 = require("discord.js");
|
|
25
|
+
const fallout_utility_1 = require("fallout-utility");
|
|
26
26
|
class RecipleClient extends discord_js_1.Client {
|
|
27
27
|
constructor(options) {
|
|
28
28
|
var _a, _b, _c;
|
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.RecipleConfig = void 0;
|
|
7
|
-
const
|
|
7
|
+
const flags_1 = require("../flags");
|
|
8
8
|
const version_1 = require("../version");
|
|
9
9
|
const fallout_utility_1 = require("fallout-utility");
|
|
10
|
-
const
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
11
|
const path_1 = __importDefault(require("path"));
|
|
12
12
|
const yaml_1 = __importDefault(require("yaml"));
|
|
13
13
|
class RecipleConfig {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RecipleCommandBuilderType } from '../../types/builders';
|
|
2
2
|
import { RecipleHaltedCommandData } from '../../types/commands';
|
|
3
|
-
import { SlashCommandBuilder } from '@discordjs/builders';
|
|
4
3
|
import { RecipleClient } from '../RecipleClient';
|
|
5
|
-
import {
|
|
4
|
+
import { SlashCommandBuilder } from '@discordjs/builders';
|
|
5
|
+
import { Awaitable, ChatInputCommandInteraction, PermissionResolvable } from 'discord.js';
|
|
6
6
|
export interface RecipleInteractionCommandExecuteData {
|
|
7
7
|
interaction: ChatInputCommandInteraction;
|
|
8
8
|
builder: InteractionCommandBuilder;
|
|
@@ -21,6 +21,10 @@ export declare class InteractionCommandBuilder extends SlashCommandBuilder {
|
|
|
21
21
|
* - `0` means no cooldown
|
|
22
22
|
*/
|
|
23
23
|
setCooldown(cooldown: number): InteractionCommandBuilder;
|
|
24
|
+
/**
|
|
25
|
+
* Set required bot permissions to execute the command
|
|
26
|
+
*/
|
|
27
|
+
setRequiredBotPermissions(...permissions: PermissionResolvable[]): InteractionCommandBuilder;
|
|
24
28
|
/**
|
|
25
29
|
* Set required permissions to execute the command
|
|
26
30
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InteractionCommandBuilder = void 0;
|
|
4
|
-
const builders_1 = require("
|
|
5
|
-
const builders_2 = require("
|
|
6
|
-
class InteractionCommandBuilder extends
|
|
4
|
+
const builders_1 = require("../../types/builders");
|
|
5
|
+
const builders_2 = require("@discordjs/builders");
|
|
6
|
+
class InteractionCommandBuilder extends builders_2.SlashCommandBuilder {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
9
|
-
this.builder =
|
|
9
|
+
this.builder = builders_1.RecipleCommandBuilderType.InteractionCommand;
|
|
10
10
|
this.cooldown = 0;
|
|
11
11
|
this.requiredBotPermissions = [];
|
|
12
12
|
this.RequiredUserPermissions = [];
|
|
@@ -21,6 +21,13 @@ class InteractionCommandBuilder extends builders_1.SlashCommandBuilder {
|
|
|
21
21
|
this.cooldown = cooldown;
|
|
22
22
|
return this;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Set required bot permissions to execute the command
|
|
26
|
+
*/
|
|
27
|
+
setRequiredBotPermissions(...permissions) {
|
|
28
|
+
this.requiredBotPermissions = permissions;
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
24
31
|
/**
|
|
25
32
|
* Set required permissions to execute the command
|
|
26
33
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RecipleCommandBuilderType } from '../../types/builders';
|
|
2
|
+
import { RecipleHaltedCommandData } from '../../types/commands';
|
|
2
3
|
import { MessageCommandOptionManager } from '../MessageCommandOptionManager';
|
|
4
|
+
import { RecipleClient } from '../RecipleClient';
|
|
5
|
+
import { MessageCommandOptionBuilder } from './MessageCommandOptionBuilder';
|
|
3
6
|
import { Awaitable, Message, PermissionResolvable } from 'discord.js';
|
|
4
|
-
import { RecipleHaltedCommandData } from '../../types/commands';
|
|
5
7
|
import { Command as CommandMessage } from 'fallout-utility';
|
|
6
|
-
import { RecipleClient } from '../RecipleClient';
|
|
7
|
-
import { RecipleCommandBuilderType } from '../../types/builders';
|
|
8
8
|
export interface RecipleMessageCommandExecuteData {
|
|
9
9
|
message: Message;
|
|
10
10
|
options: MessageCommandOptionManager;
|
|
@@ -51,7 +51,7 @@ export declare class MessageCommandBuilder {
|
|
|
51
51
|
*/
|
|
52
52
|
addAliases(...aliases: string[]): MessageCommandBuilder;
|
|
53
53
|
/**
|
|
54
|
-
* Set required
|
|
54
|
+
* Set required bot permissions to execute the command
|
|
55
55
|
*/
|
|
56
56
|
setRequiredBotPermissions(...permissions: PermissionResolvable[]): MessageCommandBuilder;
|
|
57
57
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MessageCommandBuilder = void 0;
|
|
4
|
-
const MessageCommandOptionBuilder_1 = require("./MessageCommandOptionBuilder");
|
|
5
4
|
const builders_1 = require("../../types/builders");
|
|
5
|
+
const MessageCommandOptionBuilder_1 = require("./MessageCommandOptionBuilder");
|
|
6
6
|
class MessageCommandBuilder {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.builder = builders_1.RecipleCommandBuilderType.MessageCommand;
|
|
@@ -58,7 +58,7 @@ class MessageCommandBuilder {
|
|
|
58
58
|
return this;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
* Set required
|
|
61
|
+
* Set required bot permissions to execute the command
|
|
62
62
|
*/
|
|
63
63
|
setRequiredBotPermissions(...permissions) {
|
|
64
64
|
this.requiredBotPermissions = permissions;
|
package/bin/reciple/logger.js
CHANGED
|
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.logger = void 0;
|
|
7
|
-
const fallout_utility_1 = require("fallout-utility");
|
|
8
7
|
const flags_1 = require("./flags");
|
|
9
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const fallout_utility_1 = require("fallout-utility");
|
|
10
10
|
/**
|
|
11
11
|
* Create new logger
|
|
12
12
|
*/
|
package/bin/reciple/modules.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RecipleCommandBuilders } from './types/builders';
|
|
2
1
|
import { RecipleClient } from './classes/RecipleClient';
|
|
2
|
+
import { RecipleCommandBuilders } from './types/builders';
|
|
3
3
|
export declare type LoadedModules = {
|
|
4
4
|
commands: RecipleCommandBuilders[];
|
|
5
5
|
modules: RecipleModule[];
|
package/bin/reciple/modules.js
CHANGED
|
@@ -14,10 +14,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.loadModules = void 0;
|
|
16
16
|
const builders_1 = require("./types/builders");
|
|
17
|
-
const fs_1 = require("fs");
|
|
18
17
|
const version_1 = require("./version");
|
|
19
|
-
const
|
|
18
|
+
const fs_1 = require("fs");
|
|
20
19
|
const path_1 = __importDefault(require("path"));
|
|
20
|
+
const wildcard_match_1 = __importDefault(require("wildcard-match"));
|
|
21
21
|
/**
|
|
22
22
|
* Load modules from folder
|
|
23
23
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Guild, PermissionResolvable, PermissionsBitField } from 'discord.js';
|
|
2
|
-
import { RecipleCommandBuilders } from './types/builders';
|
|
3
1
|
import { Config } from './classes/RecipleConfig';
|
|
2
|
+
import { RecipleCommandBuilders } from './types/builders';
|
|
3
|
+
import { Guild, PermissionResolvable, PermissionsBitField } from 'discord.js';
|
|
4
4
|
/**
|
|
5
5
|
* Check if the user has permissions to execute the given command name
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InteractionCommandBuilder } from './classes/builders/InteractionCommandBuilder';
|
|
2
|
-
import { ContextMenuCommandBuilder, SlashCommandBuilder } from '@discordjs/builders';
|
|
3
2
|
import { RegisterInteractionCommandsOptions } from './types/paramOptions';
|
|
3
|
+
import { ContextMenuCommandBuilder, SlashCommandBuilder } from '@discordjs/builders';
|
|
4
4
|
export declare type InteractionBuilder = ContextMenuCommandBuilder | InteractionCommandBuilder | SlashCommandBuilder;
|
|
5
5
|
/**
|
|
6
6
|
* Register interaction commands
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InteractionCommandBuilder, RecipleInteractionCommandExecuteData } from '../classes/builders/InteractionCommandBuilder';
|
|
2
2
|
import { RecipleMessageCommandExecuteData } from '../classes/builders/MessageCommandBuilder';
|
|
3
|
-
import { MessageCommandOptionManager } from '../classes/MessageCommandOptionManager';
|
|
4
3
|
import { CooledDownUser } from '../classes/CommandCooldownManager';
|
|
4
|
+
import { MessageCommandOptionManager } from '../classes/MessageCommandOptionManager';
|
|
5
5
|
import { RecipleCommandBuilders } from '../types/builders';
|
|
6
6
|
export declare type RecipleHaltedCommandData<Builder extends RecipleCommandBuilders> = CommandErrorData<Builder> | CommandCooldownData<Builder> | (Builder extends InteractionCommandBuilder ? never : CommandInvalidArguments<Builder> | CommandMissingArguments<Builder>) | CommandMissingMemberPermissions<Builder> | CommandMissingBotPermissions<Builder>;
|
|
7
7
|
export interface CommandHaltBaseData<Builder extends RecipleCommandBuilders> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InteractionBuilder } from '../registerInteractionCommands';
|
|
2
|
-
import { RecipleModule, RecipleScript } from '../modules';
|
|
3
1
|
import { RecipleClient } from '../classes/RecipleClient';
|
|
2
|
+
import { RecipleModule, RecipleScript } from '../modules';
|
|
3
|
+
import { InteractionBuilder } from '../registerInteractionCommands';
|
|
4
4
|
import { ApplicationCommandData } from 'discord.js';
|
|
5
5
|
export interface AddModuleOptions {
|
|
6
6
|
/**
|