reciple 4.0.0-pre.4 → 4.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 CHANGED
@@ -16,11 +16,11 @@ var _a, _b, _c, _d;
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  const RecipleClient_1 = require("./reciple/classes/RecipleClient");
18
18
  const RecipleConfig_1 = require("./reciple/classes/RecipleConfig");
19
- const flags_1 = require("./reciple/flags");
20
19
  const version_1 = require("./reciple/version");
21
- const chalk_1 = __importDefault(require("chalk"));
22
- const fallout_utility_1 = require("fallout-utility");
23
20
  const fs_1 = require("fs");
21
+ const flags_1 = require("./reciple/flags");
22
+ const fallout_utility_1 = require("fallout-utility");
23
+ const chalk_1 = __importDefault(require("chalk"));
24
24
  require("dotenv/config");
25
25
  const allowedFiles = ['node_modules', 'reciple.yml', 'package.json'];
26
26
  if ((0, fs_1.readdirSync)('./').filter(f => !f.startsWith('.') && allowedFiles.indexOf(f)).length > 0 && !(0, fs_1.existsSync)((_a = flags_1.flags.config) !== null && _a !== void 0 ? _a : './reciple.yml')) {
package/bin/index.d.ts CHANGED
@@ -12,5 +12,5 @@ export * from './reciple/flags';
12
12
  export * from './reciple/logger';
13
13
  export * from './reciple/modules';
14
14
  export * from './reciple/permissions';
15
- export * from './reciple/registerInteractionCommands';
15
+ export * from './reciple/registerApplicationCommands';
16
16
  export * from './reciple/version';
package/bin/index.js CHANGED
@@ -28,5 +28,5 @@ __exportStar(require("./reciple/flags"), exports);
28
28
  __exportStar(require("./reciple/logger"), exports);
29
29
  __exportStar(require("./reciple/modules"), exports);
30
30
  __exportStar(require("./reciple/permissions"), exports);
31
- __exportStar(require("./reciple/registerInteractionCommands"), exports);
31
+ __exportStar(require("./reciple/registerApplicationCommands"), exports);
32
32
  __exportStar(require("./reciple/version"), exports);
@@ -1,5 +1,5 @@
1
- import { CommandBuilderType } from '../types/builders';
2
1
  import { Guild, TextBasedChannel, User } from 'discord.js';
2
+ import { CommandBuilderType } from '../types/builders';
3
3
  /**
4
4
  * Object interface for cooled-down user
5
5
  */
@@ -1,13 +1,13 @@
1
- import { RecipleModule } from '../modules';
2
- import { ApplicationCommandBuilder } from '../registerInteractionCommands';
3
- import { CommandBuilder, CommandBuilderType } from '../types/builders';
4
- import { RecipleClientAddModuleOptions } from '../types/paramOptions';
5
1
  import { MessageCommandBuilder, MessageCommandExecuteData } from './builders/MessageCommandBuilder';
2
+ import { ApplicationCommandBuilder } from '../registerApplicationCommands';
3
+ import { CommandBuilder, CommandBuilderType } from '../types/builders';
6
4
  import { SlashCommandBuilder, SlashCommandExecuteData } from './builders/SlashCommandBuilder';
7
5
  import { CommandCooldownManager } from './CommandCooldownManager';
6
+ import { RecipleClientAddModuleOptions } from '../types/paramOptions';
7
+ import { Logger as ILogger } from 'fallout-utility';
8
8
  import { Config } from './RecipleConfig';
9
+ import { RecipleModule } from '../modules';
9
10
  import { ApplicationCommandData, Awaitable, ChatInputCommandInteraction, Client, ClientEvents, ClientOptions, Interaction, Message } from 'discord.js';
10
- import { Logger as ILogger } from 'fallout-utility';
11
11
  /**
12
12
  * options for Reciple client
13
13
  */
@@ -49,9 +49,6 @@ export interface RecipleClient<Ready extends boolean = boolean> extends Client<R
49
49
  removeAllListeners(event?: string | symbol): this;
50
50
  isReady(): this is RecipleClient<true>;
51
51
  }
52
- /**
53
- * The reciple client
54
- */
55
52
  export declare class RecipleClient<Ready extends boolean = boolean> extends Client<Ready> {
56
53
  config: Config;
57
54
  commands: RecipleClientCommands;
@@ -10,23 +10,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.RecipleClient = void 0;
13
- // Not cool code
14
- const logger_1 = require("../logger");
15
- const modules_1 = require("../modules");
13
+ const MessageCommandBuilder_1 = require("./builders/MessageCommandBuilder");
16
14
  const permissions_1 = require("../permissions");
17
- const registerInteractionCommands_1 = require("../registerInteractionCommands");
15
+ const registerApplicationCommands_1 = require("../registerApplicationCommands");
18
16
  const builders_1 = require("../types/builders");
19
- const commands_1 = require("../types/commands");
20
- const version_1 = require("../version");
21
- const MessageCommandBuilder_1 = require("./builders/MessageCommandBuilder");
22
17
  const CommandCooldownManager_1 = require("./CommandCooldownManager");
23
18
  const MessageCommandOptionManager_1 = require("./MessageCommandOptionManager");
19
+ const commands_1 = require("../types/commands");
20
+ const fallout_utility_1 = require("fallout-utility");
24
21
  const RecipleConfig_1 = require("./RecipleConfig");
22
+ const modules_1 = require("../modules");
23
+ const logger_1 = require("../logger");
24
+ const version_1 = require("../version");
25
25
  const discord_js_1 = require("discord.js");
26
- const fallout_utility_1 = require("fallout-utility");
27
- /**
28
- * The reciple client
29
- */
30
26
  class RecipleClient extends discord_js_1.Client {
31
27
  /**
32
28
  * @param options Client options
@@ -92,7 +88,7 @@ class RecipleClient extends discord_js_1.Client {
92
88
  this.logger.info(`${Object.keys(this.commands.slashCommands).length} slash commands loaded.`);
93
89
  }
94
90
  if (this.config.commands.slashCommand.registerCommands) {
95
- yield (0, registerInteractionCommands_1.registerApplicationCommands)({
91
+ yield (0, registerApplicationCommands_1.registerApplicationCommands)({
96
92
  client: this,
97
93
  commands: [...Object.values(this.commands.slashCommands), ...this.otherApplicationCommandData],
98
94
  guilds: this.config.commands.slashCommand.guilds
@@ -125,7 +121,7 @@ class RecipleClient extends discord_js_1.Client {
125
121
  this.addCommand(command);
126
122
  }
127
123
  if (registerCommands)
128
- yield (0, registerInteractionCommands_1.registerApplicationCommands)({
124
+ yield (0, registerApplicationCommands_1.registerApplicationCommands)({
129
125
  client: this,
130
126
  commands: [...Object.values(this.commands.slashCommands), ...this.otherApplicationCommandData],
131
127
  guilds: this.config.commands.slashCommand.guilds
@@ -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 flags_1 = require("../flags");
7
+ const fs_1 = require("fs");
8
8
  const version_1 = require("../version");
9
9
  const fallout_utility_1 = require("fallout-utility");
10
- const fs_1 = require("fs");
10
+ const flags_1 = require("../flags");
11
11
  const path_1 = __importDefault(require("path"));
12
12
  const yaml_1 = __importDefault(require("yaml"));
13
13
  /**
@@ -1,10 +1,10 @@
1
- import { CommandBuilderType } from '../../types/builders';
2
- import { HaltedCommandData } from '../../types/commands';
3
1
  import { MessageCommandOptionManager } from '../MessageCommandOptionManager';
4
- import { RecipleClient } from '../RecipleClient';
5
2
  import { MessageCommandOptionBuilder } from './MessageCommandOptionBuilder';
6
3
  import { Awaitable, Message, PermissionResolvable } from 'discord.js';
7
4
  import { Command as CommandMessage } from 'fallout-utility';
5
+ import { CommandBuilderType } from '../../types/builders';
6
+ import { HaltedCommandData } from '../../types/commands';
7
+ import { RecipleClient } from '../RecipleClient';
8
8
  /**
9
9
  * Execute data for message command
10
10
  */
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateMessageCommandOptions = exports.MessageCommandBuilder = void 0;
4
- const builders_1 = require("../../types/builders");
5
4
  const MessageCommandOptionManager_1 = require("../MessageCommandOptionManager");
6
5
  const MessageCommandOptionBuilder_1 = require("./MessageCommandOptionBuilder");
6
+ const builders_1 = require("../../types/builders");
7
7
  /**
8
8
  * Reciple builder for message command
9
9
  */
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createLogger = void 0;
7
+ const fallout_utility_1 = require("fallout-utility");
7
8
  const flags_1 = require("./flags");
8
9
  const chalk_1 = __importDefault(require("chalk"));
9
- const fallout_utility_1 = require("fallout-utility");
10
10
  /**
11
11
  * Create new logger
12
12
  * @param stringifyJSON stringify json objects in console
@@ -1,5 +1,5 @@
1
- import { RecipleClient } from './classes/RecipleClient';
2
1
  import { CommandBuilder } from './types/builders';
2
+ import { RecipleClient } from './classes/RecipleClient';
3
3
  export declare type LoadedModules = {
4
4
  commands: CommandBuilder[];
5
5
  modules: RecipleModule[];
@@ -16,8 +16,8 @@ exports.loadModules = void 0;
16
16
  const builders_1 = require("./types/builders");
17
17
  const version_1 = require("./version");
18
18
  const fs_1 = require("fs");
19
- const path_1 = __importDefault(require("path"));
20
19
  const wildcard_match_1 = __importDefault(require("wildcard-match"));
20
+ const path_1 = __importDefault(require("path"));
21
21
  /**
22
22
  * Load modules from folder
23
23
  * @param client Reciple client
@@ -1,6 +1,6 @@
1
- import { Config } from './classes/RecipleConfig';
2
1
  import { UserHasCommandPermissionsOptions } from './types/paramOptions';
3
2
  import { Guild, PermissionResolvable } from 'discord.js';
3
+ import { Config } from './classes/RecipleConfig';
4
4
  /**
5
5
  * Check if the user has permissions to execute the given command name
6
6
  * @param options options
@@ -1,6 +1,6 @@
1
+ import { ContextMenuCommandBuilder, SlashCommandBuilder as DiscordJsSlashCommandBuilder } from 'discord.js';
1
2
  import { SlashCommandBuilder } from './classes/builders/SlashCommandBuilder';
2
3
  import { RegisterApplicationCommandsOptions } from './types/paramOptions';
3
- import { ContextMenuCommandBuilder, SlashCommandBuilder as DiscordJsSlashCommandBuilder } from 'discord.js';
4
4
  export declare type ApplicationCommandBuilder = SlashCommandBuilder | ContextMenuCommandBuilder | DiscordJsSlashCommandBuilder;
5
5
  /**
6
6
  * Register application commands
@@ -1,7 +1,7 @@
1
1
  import { MessageCommandExecuteData } from '../classes/builders/MessageCommandBuilder';
2
2
  import { SlashCommandBuilder, SlashCommandExecuteData } from '../classes/builders/SlashCommandBuilder';
3
- import { CooledDownUser } from '../classes/CommandCooldownManager';
4
3
  import { MessageCommandOptionManager } from '../classes/MessageCommandOptionManager';
4
+ import { CooledDownUser } from '../classes/CommandCooldownManager';
5
5
  import { CommandBuilder } from '../types/builders';
6
6
  /**
7
7
  * Halted command's data
@@ -1,9 +1,9 @@
1
+ import { ApplicationCommandBuilder } from '../registerApplicationCommands';
2
+ import { ApplicationCommandData, PermissionsBitField } from 'discord.js';
3
+ import { RecipleModule, RecipleScript } from '../modules';
1
4
  import { RecipleClient } from '../classes/RecipleClient';
2
5
  import { Config } from '../classes/RecipleConfig';
3
- import { RecipleModule, RecipleScript } from '../modules';
4
- import { ApplicationCommandBuilder } from '../registerInteractionCommands';
5
6
  import { CommandBuilder } from './builders';
6
- import { ApplicationCommandData, PermissionsBitField } from 'discord.js';
7
7
  export interface RecipleClientAddModuleOptions {
8
8
  /**
9
9
  * The Module script
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reciple",
3
- "version": "4.0.0-pre.4",
3
+ "version": "4.0.0",
4
4
  "bin": "bin/bin.js",
5
5
  "license": "GPL-3.0",
6
6
  "main": "bin/index.js",