reciple 9.0.0-dev.1 → 9.0.0-dev.10

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/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  <h1 align="center">
2
- <img src="https://i.imgur.com/DWM0tJL.png" width="50%">
2
+ <img src="https://i.imgur.com/h0ljJR5.png" width="50%">
3
3
  <br>
4
4
  </h1>
5
5
 
6
6
  <h3 align="center">
7
- <a href="https://discord.ggthenorthsolution1">
7
+ <a href="https://discord.gg/thenorthsolution">
8
8
  <img src="https://img.shields.io/discord/1032785824686817291?color=5865F2&logo=discord&logoColor=white">
9
9
  </a>
10
10
  <a href="https://npmjs.org/package/reciple">
@@ -18,8 +18,8 @@
18
18
  </a>
19
19
  <br>
20
20
  <div style="padding-top: 1rem">
21
- <a href="https://discord.ggthenorthsolution1">
22
- <img src="https://discord.com/api/guilds/1032785824686817291/embed.png?style=banner2">
21
+ <a href="https://discord.gg/thenorthsolution">
22
+ <img src="http://invidget.switchblade.xyz/thenorthsolution">
23
23
  </a>
24
24
  </div>
25
25
  </h3>
@@ -13,14 +13,42 @@ export interface CLIOptions {
13
13
  [k: string]: any;
14
14
  }
15
15
  export declare const cli: {
16
+ /**
17
+ * This property returns the command-line arguments passed to the CLI. It is an array of strings, where each string represents an argument.
18
+ */
16
19
  readonly args: string[];
20
+ /**
21
+ * This property returns the command-line options passed to the CLI. It is an object with keys and values depending on the options specified in the command-line arguments.
22
+ */
17
23
  readonly options: CLIOptions;
24
+ /**
25
+ * This property returns the current working directory (CWD) of the CLI. It takes into account the command-line arguments passed to the CLI.
26
+ */
18
27
  readonly cwd: string;
28
+ /**
29
+ * This property returns a boolean value indicating whether shard mode is enabled or not.
30
+ * It is enabled if the shardmode option is specified in the command-line arguments, or if the `SHARDMODE` environment variable is set to `1`. Otherwise, it is disabled.
31
+ */
19
32
  readonly shardmode: boolean;
33
+ /**
34
+ * This property returns the thread ID of the current thread, if it is not the main thread.
35
+ */
20
36
  threadId: number | undefined;
37
+ /**
38
+ * This property is used to store a boolean value indicating whether the CWD has been updated or not.
39
+ */
21
40
  isCwdUpdated: boolean;
41
+ /**
42
+ * This property returns the current working directory of the Node.js process.
43
+ */
22
44
  nodeCwd: string;
45
+ /**
46
+ * This property returns the path of the bin.mjs file, which is the main entry point of the CLI.
47
+ */
23
48
  binPath: string;
49
+ /**
50
+ * This property is used to store the path of the log file.
51
+ */
24
52
  logPath: string | undefined;
25
53
  };
26
54
  export declare const cliVersion: string;
package/dist/utils/cli.js CHANGED
@@ -3,9 +3,9 @@ import { buildVersion } from '@reciple/core';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { readFileSync } from 'node:fs';
5
5
  import { Command } from 'commander';
6
- import { coerce } from 'semver';
7
6
  import path from 'node:path';
8
7
  import { PackageUpdateChecker } from '@reciple/utils';
8
+ import { coerce } from 'semver';
9
9
  const { version, description } = JSON.parse(readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), '../../package.json'), 'utf-8'));
10
10
  const originalCwd = process.cwd();
11
11
  export let command = new Command()
@@ -22,18 +22,46 @@ export let command = new Command()
22
22
  .option('--setup', 'Create required config without starting the bot')
23
23
  .allowUnknownOption(true);
24
24
  export const cli = {
25
+ /**
26
+ * This property returns the command-line arguments passed to the CLI. It is an array of strings, where each string represents an argument.
27
+ */
25
28
  get args() { return command.args; },
29
+ /**
30
+ * This property returns the command-line options passed to the CLI. It is an object with keys and values depending on the options specified in the command-line arguments.
31
+ */
26
32
  get options() { return command.opts(); },
33
+ /**
34
+ * This property returns the current working directory (CWD) of the CLI. It takes into account the command-line arguments passed to the CLI.
35
+ */
27
36
  get cwd() {
28
37
  return this.args[0]
29
38
  ? path.isAbsolute(this.args[0]) ? this.args[0] : path.join(originalCwd, this.args[0])
30
39
  : process.cwd();
31
40
  },
41
+ /**
42
+ * This property returns a boolean value indicating whether shard mode is enabled or not.
43
+ * It is enabled if the shardmode option is specified in the command-line arguments, or if the `SHARDMODE` environment variable is set to `1`. Otherwise, it is disabled.
44
+ */
32
45
  get shardmode() { return !!(this.options.shardmode ?? process.env.SHARDMODE); },
46
+ /**
47
+ * This property returns the thread ID of the current thread, if it is not the main thread.
48
+ */
33
49
  threadId: !isMainThread && parentPort !== undefined ? threadId : undefined,
50
+ /**
51
+ * This property is used to store a boolean value indicating whether the CWD has been updated or not.
52
+ */
34
53
  isCwdUpdated: false,
54
+ /**
55
+ * This property returns the current working directory of the Node.js process.
56
+ */
35
57
  nodeCwd: process.cwd(),
58
+ /**
59
+ * This property returns the path of the bin.mjs file, which is the main entry point of the CLI.
60
+ */
36
61
  binPath: path.join(path.dirname(fileURLToPath(import.meta.url)), '../bin.mjs'),
62
+ /**
63
+ * This property is used to store the path of the log file.
64
+ */
37
65
  logPath: undefined
38
66
  };
39
67
  export const cliVersion = `${coerce(version)}`;
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/utils/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,oBAAoB,CA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
3
  "description": "Reciple is a Discord.js bot framework",
4
4
  "homepage": "https://reciple.js.org/docs/reciple",
5
5
  "license": "GPL-3.0",
6
- "version": "9.0.0-dev.1",
6
+ "version": "9.0.0-dev.10",
7
7
  "module": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
9
9
  "bin": "./dist/bin.js",
@@ -24,7 +24,7 @@
24
24
  "types": "./dist/index.d.ts",
25
25
  "import": "./dist/index.js"
26
26
  },
27
- "./config.mjs": {
27
+ "./config": {
28
28
  "types": "./static/config.d.mts",
29
29
  "import": "./static/config.mjs"
30
30
  }
@@ -40,8 +40,7 @@
40
40
  "README.md"
41
41
  ],
42
42
  "dependencies": {
43
- "@reciple/update-checker": "^9.1.0",
44
- "@reciple/utils": "^9.0.0-dev.1",
43
+ "@reciple/utils": "^9.0.0-dev.3",
45
44
  "commander": "^12.1.0",
46
45
  "dotenv": "^16.4.5",
47
46
  "fallout-utility": "^2.9.1",
@@ -51,14 +50,14 @@
51
50
  "semver": "^7.6.2"
52
51
  },
53
52
  "devDependencies": {
54
- "@reciple/core": "^9.0.0-dev.1",
53
+ "@reciple/core": "^9.0.0-dev.6",
55
54
  "@types/micromatch": "^4.0.7",
56
55
  "@types/semver": "^7.5.8",
57
56
  "discord.js": "^14.15.2"
58
57
  },
59
58
  "peerDependencies": {
60
- "@reciple/core": "^8.0.0",
61
- "discord.js": "^14.7.1"
59
+ "@reciple/core": "^9 || ^9.0.0-dev",
60
+ "discord.js": "^14.15.0"
62
61
  },
63
- "gitHead": "82b28d5666006b7cc21ab95064bf5d62f06d54db"
62
+ "gitHead": "b1a4dd9fcc6e2279488381d46f44ecb2d2d97593"
64
63
  }
package/static/config.mjs CHANGED
@@ -1,78 +1,79 @@
1
- // @ts-check
2
- import { CooldownPrecondition, CommandPermissionsPrecondition } from 'reciple';
3
- import { IntentsBitField } from 'discord.js';
4
- import { cliVersion } from 'reciple';
5
-
6
- /**
7
- * @satisfies {import('reciple').RecipleConfig}
8
- */
9
- export const config = {
10
- token: process.env.TOKEN ?? '',
11
- commands: {
12
- contextMenuCommand: {
13
- enabled: true,
14
- enableCooldown: true,
15
- acceptRepliedInteractions: false,
16
- registerCommands: {
17
- registerGlobally: true,
18
- registerToGuilds: []
19
- }
20
- },
21
- messageCommand: {
22
- enabled: true,
23
- enableCooldown: true,
24
- commandArgumentSeparator: ' ',
25
- prefix: '!'
26
- },
27
- slashCommand: {
28
- enabled: true,
29
- enableCooldown: true,
30
- acceptRepliedInteractions: false,
31
- registerCommands: {
32
- registerGlobally: true,
33
- registerToGuilds: []
34
- }
35
- }
36
- },
37
- applicationCommandRegister: {
38
- enabled: true,
39
- allowRegisterGlobally: true,
40
- allowRegisterToGuilds: true,
41
- registerEmptyCommands: true,
42
- registerToGuilds: []
43
- },
44
- client: {
45
- intents: [
46
- IntentsBitField.Flags.Guilds,
47
- IntentsBitField.Flags.GuildMembers,
48
- IntentsBitField.Flags.GuildMessages,
49
- IntentsBitField.Flags.MessageContent,
50
- ]
51
- },
52
- logger: {
53
- enabled: true,
54
- debugmode: null,
55
- coloredMessages: true,
56
- disableLogPrefix: false,
57
- logToFile: {
58
- enabled: true,
59
- logsFolder: './logs',
60
- file: 'latest.log'
61
- }
62
- },
63
- modules: {
64
- dirs: ['./modules'],
65
- exclude: [],
66
- filter: file => true,
67
- disableModuleVersionCheck: false
68
- },
69
- preconditions: [
70
- CooldownPrecondition.create(),
71
- CommandPermissionsPrecondition.create()
72
- ],
73
- cooldownSweeperOptions: {
74
- timer: 1000 * 60 * 60
75
- },
76
- checkForUpdates: true,
77
- version: `^${cliVersion}`
78
- };
1
+ // @ts-check
2
+ import { CooldownPrecondition, CommandPermissionsPrecondition } from 'reciple';
3
+ import { IntentsBitField } from 'discord.js';
4
+ import { cliVersion } from 'reciple';
5
+
6
+ /**
7
+ * @satisfies {import('reciple').RecipleConfig}
8
+ */
9
+ export const config = {
10
+ token: process.env.TOKEN ?? '',
11
+ commands: {
12
+ contextMenuCommand: {
13
+ enabled: true,
14
+ enableCooldown: true,
15
+ acceptRepliedInteractions: false,
16
+ registerCommands: {
17
+ registerGlobally: true,
18
+ registerToGuilds: []
19
+ }
20
+ },
21
+ messageCommand: {
22
+ enabled: true,
23
+ enableCooldown: true,
24
+ commandArgumentSeparator: ' ',
25
+ prefix: '!'
26
+ },
27
+ slashCommand: {
28
+ enabled: true,
29
+ enableCooldown: true,
30
+ acceptRepliedInteractions: false,
31
+ registerCommands: {
32
+ registerGlobally: true,
33
+ registerToGuilds: []
34
+ }
35
+ }
36
+ },
37
+ applicationCommandRegister: {
38
+ enabled: true,
39
+ allowRegisterGlobally: true,
40
+ allowRegisterToGuilds: true,
41
+ registerEmptyCommands: true,
42
+ registerToGuilds: []
43
+ },
44
+ client: {
45
+ intents: [
46
+ IntentsBitField.Flags.Guilds,
47
+ IntentsBitField.Flags.GuildMembers,
48
+ IntentsBitField.Flags.GuildMessages,
49
+ IntentsBitField.Flags.MessageContent,
50
+ ]
51
+ },
52
+ logger: {
53
+ enabled: true,
54
+ debugmode: null,
55
+ coloredMessages: true,
56
+ disableLogPrefix: false,
57
+ logToFile: {
58
+ enabled: true,
59
+ logsFolder: './logs',
60
+ file: 'latest.log'
61
+ }
62
+ },
63
+ modules: {
64
+ dirs: ['./modules'],
65
+ exclude: [],
66
+ filter: file => true,
67
+ disableModuleVersionCheck: false
68
+ },
69
+ preconditions: [
70
+ new CooldownPrecondition(),
71
+ new CommandPermissionsPrecondition()
72
+ ],
73
+ commandHalts: [],
74
+ cooldownSweeperOptions: {
75
+ timer: 1000 * 60 * 60
76
+ },
77
+ checkForUpdates: true,
78
+ version: `^${cliVersion}`
79
+ };