reciple 1.4.0 → 1.4.1

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.
@@ -1,4 +1,4 @@
1
- import { ApplicationCommandDataResolvable, Client, ClientEvents, ClientOptions, Interaction, Message } from 'discord.js';
1
+ import { ApplicationCommandDataResolvable, Awaitable, Client, ClientEvents, ClientOptions, Interaction, Message } from 'discord.js';
2
2
  import { InteractionCommandBuilder, RecipleInteractionCommandExecute } from './builders/InteractionCommandBuilder';
3
3
  import { recipleCommandBuilders, RecipleScript } from '../modules';
4
4
  import { interactionCommandBuilders } from '../registerInteractionCommands';
@@ -20,6 +20,18 @@ export interface RecipleClientEvents extends ClientEvents {
20
20
  recipleMessageCommandCreate: [command: RecipleMessageCommandExecute];
21
21
  recipleInteractionCommandCreate: [command: RecipleInteractionCommandExecute];
22
22
  }
23
+ export interface RecipleClient extends Client {
24
+ on<E extends keyof RecipleClientEvents>(event: E, listener: (...args: RecipleClientEvents[E]) => Awaitable<void>): this;
25
+ on<E extends string | symbol>(event: Exclude<E, keyof RecipleClientEvents>, listener: (...args: any) => Awaitable<void>): this;
26
+ once<E extends keyof RecipleClientEvents>(event: E, listener: (...args: RecipleClientEvents[E]) => Awaitable<void>): this;
27
+ once<E extends keyof string | symbol>(event: Exclude<E, keyof RecipleClientEvents>, listener: (...args: any) => Awaitable<void>): this;
28
+ emit<E extends keyof RecipleClientEvents>(event: E, ...args: RecipleClientEvents[E]): boolean;
29
+ emit<E extends string | symbol>(event: Exclude<E, keyof RecipleClientEvents>, ...args: any): boolean;
30
+ off<E extends keyof RecipleClientEvents>(event: E, listener: (...args: RecipleClientEvents[E]) => Awaitable<void>): this;
31
+ off<E extends string | symbol>(event: Exclude<E, keyof RecipleClientEvents>, listener: (...args: any) => Awaitable<void>): this;
32
+ removeAllListeners<E extends keyof RecipleClientEvents>(event?: E): this;
33
+ removeAllListeners(event?: string | symbol): this;
34
+ }
23
35
  export declare class RecipleClient extends Client {
24
36
  config?: Config;
25
37
  commands: RecipleClientCommands;
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.loadModules = void 0;
16
16
  const fs_1 = require("fs");
17
17
  const version_1 = require("./version");
18
+ const wildcard_match_1 = __importDefault(require("wildcard-match"));
18
19
  const path_1 = __importDefault(require("path"));
19
20
  function loadModules(client) {
20
21
  var _a, _b, _c;
@@ -26,7 +27,7 @@ function loadModules(client) {
26
27
  (0, fs_1.mkdirSync)(modulesDir, { recursive: true });
27
28
  const ignoredFiles = (((_b = client.config) === null || _b === void 0 ? void 0 : _b.ignoredFiles) || []).map(file => file.endsWith('.js') ? file : `${file}.js`);
28
29
  const scripts = (0, fs_1.readdirSync)(modulesDir).filter(file => {
29
- return file.endsWith('.js') && (!file.startsWith('_') && !file.startsWith('.')) && !ignoredFiles.includes(file);
30
+ return file.endsWith('.js') && (!file.startsWith('_') && !file.startsWith('.')) && !ignoredFiles.some(f => (0, wildcard_match_1.default)(f)(file));
30
31
  });
31
32
  for (const script of scripts) {
32
33
  const modulePath = path_1.default.resolve(modulesDir, script);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reciple",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "A Discord.js bot",
5
5
  "author": "FalloutStudios",
6
6
  "license": "GPL-3.0",
@@ -29,11 +29,12 @@
29
29
  "dotenv": "^16.0.1",
30
30
  "fallout-utility": "^1.3.14",
31
31
  "semver": "^7.3.7",
32
+ "wildcard-match": "^5.1.2",
32
33
  "yaml": "^2.1.1"
33
34
  },
34
35
  "devDependencies": {
35
- "@types/node": "^17.0.41",
36
- "@types/semver": "^7.3.9",
37
- "typescript": "^4.7.3"
36
+ "@types/node": "^18.0.0",
37
+ "@types/semver": "^7.3.10",
38
+ "typescript": "^4.7.4"
38
39
  }
39
40
  }