@sapphire/plugin-subcommands 7.0.0 → 7.0.1-next.3b2c2df

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/CHANGELOG.md CHANGED
@@ -7,9 +7,9 @@ All notable changes to this project will be documented in this file.
7
7
  ## 🏠 Refactor
8
8
 
9
9
  - Changed no match errors to emit on a subcommand listener instead of the root MessageCommandError / ChatInputCommandError ([6e7a5bf](https://github.com/sapphiredev/plugins/commit/6e7a5bf89feb869e656cb1a07bb29a664b1ebd41)) ([#601](https://github.com/sapphiredev/plugins/pull/601) by @favna)
10
- - 💥 **BREAKING CHANGE:** If no subcommand matched the error was emitted to `MessageCommandError` or `ChatInputCommandError`.
11
- This was inconsistent with errors during runtime emitted to `MessageSubcommandError` and `ChatInputSubcommandError` respectively.
12
- Therefore these events are now emitted to the new events `PluginMessageSubcommandNoMatch` and `PluginChatInputSubcommandNoMatch` respectively.
10
+ - 💥 **BREAKING CHANGE:** If no subcommand matched the error was emitted to `MessageCommandError` or `ChatInputCommandError`.
11
+ This was inconsistent with errors during runtime emitted to `MessageSubcommandError` and `ChatInputSubcommandError` respectively.
12
+ Therefore these events are now emitted to the new events `PluginMessageSubcommandNoMatch` and `PluginChatInputSubcommandNoMatch` respectively.
13
13
  New built-in listeners for these events will log the infractions to the console at the error level. You can override these listeners to provide your functionality.
14
14
 
15
15
  ## 🐛 Bug Fixes
@@ -33,7 +33,7 @@ var subcommandCooldown_cjs__namespace = /*#__PURE__*/_interopNamespace(subcomman
33
33
  var SubcommandPreconditions = {
34
34
  PluginSubcommandCooldown: PluginSubcommandCooldown_cjs.PluginPrecondition
35
35
  };
36
- var version = "7.0.0";
36
+ var version = "7.0.1-next.3b2c2df";
37
37
 
38
38
  Object.defineProperty(exports, "PluginSubcommandCooldownPrecondition", {
39
39
  enumerable: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"names":["PluginSubcommandCooldown"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDO,IAAM,uBAA0B,GAAA;AAAA,4BACtCA,+CAAA;AACD,EAAA;AAoBO,IAAM,OAAkB,GAAA","file":"index.cjs","sourcesContent":["import type { CooldownOptions } from '@sapphire/framework';\nimport {\n\tPluginPrecondition as PluginSubcommandCooldown,\n\ttype PluginSubcommandCooldownPreconditionContext\n} from './preconditions/PluginSubcommandCooldown';\n\nexport * from './lib/Subcommand';\nexport * as SubcommandPreconditionResolvers from './lib/precondition-resolvers/subcommandCooldown';\nexport * from './lib/types/Enums';\nexport * from './lib/types/Events';\nexport * from './lib/types/SubcommandMappings';\nexport {\n\tPluginPrecondition as PluginSubcommandCooldownPrecondition,\n\ttype PluginSubcommandCooldownPreconditionContext\n} from './preconditions/PluginSubcommandCooldown';\n\nexport { loadListeners } from './listeners/_load';\nexport { loadPreconditions } from './preconditions/_load';\n\ndeclare module 'discord.js' {\n\tinterface ClientOptions {\n\t\t/**\n\t\t * If Plugin-subcommand to load pre-included subcommand error event listeners that log any encountered errors to the {@link SapphireClient.logger} instance\n\t\t * @since 3.1.2\n\t\t * @default true\n\t\t */\n\t\tloadSubcommandErrorListeners?: boolean;\n\t\t/**\n\t\t * Sets the default cooldown time for all subcommands.\n\t\t * @remark This is separate from {@link ClientOptions.defaultCooldown} as it is only used for subcommands\n\t\t * @remark Note that for the `filteredCommands` option you have to provide it as\n\t\t * - For a subcommand without a group: `commandName.subcommandName` (e.g. `config.show`).\n\t\t * - For a subcommand with a group: `commandName.groupName.subcommandName` (e.g. `config.set.prefix`).\n\t\t * @since 5.1.0\n\t\t * @default \"No cooldown options\"\n\t\t */\n\t\tsubcommandDefaultCooldown?: CooldownOptions;\n\t}\n}\n\ndeclare module '@sapphire/framework' {\n\tinterface Preconditions {\n\t\tPluginSubcommandCooldown: SubcommandPreconditions.PluginSubcommandCooldownContext;\n\t}\n}\n\n/**\n * The preconditions specific to subcommands\n * @since 5.1.0\n * @deprecated - This will be replaced with a regular top level export of {@link PluginSubcommandCooldown}\n * in the next major version as opposed to a namespaced export.\n */\nexport const SubcommandPreconditions = {\n\tPluginSubcommandCooldown\n};\n\n/**\n * The preconditions specific to subcommands\n * @since 5.1.0\n * @deprecated - This will be replaced with a regular top level export of {@link PluginSubcommandCooldownPreconditionContext}\n * in the next major version as opposed to a namespaced export.\n */\nexport namespace SubcommandPreconditions {\n\t/** The context for the subcommand cooldown precondition */\n\texport type PluginSubcommandCooldownContext = PluginSubcommandCooldownPreconditionContext;\n}\n\n/**\n * The [@sapphire/plugin-subcommands](https://github.com/sapphiredev/plugins/blob/main/packages/subcommands) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '7.0.0';\n"]}
1
+ {"version":3,"sources":["../../src/index.ts"],"names":["PluginSubcommandCooldown"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDO,IAAM,uBAA0B,GAAA;AAAA,4BACtCA,+CAAA;AACD,EAAA;AAoBO,IAAM,OAAkB,GAAA","file":"index.cjs","sourcesContent":["import type { CooldownOptions } from '@sapphire/framework';\nimport {\n\tPluginPrecondition as PluginSubcommandCooldown,\n\ttype PluginSubcommandCooldownPreconditionContext\n} from './preconditions/PluginSubcommandCooldown';\n\nexport * from './lib/Subcommand';\nexport * as SubcommandPreconditionResolvers from './lib/precondition-resolvers/subcommandCooldown';\nexport * from './lib/types/Enums';\nexport * from './lib/types/Events';\nexport * from './lib/types/SubcommandMappings';\nexport {\n\tPluginPrecondition as PluginSubcommandCooldownPrecondition,\n\ttype PluginSubcommandCooldownPreconditionContext\n} from './preconditions/PluginSubcommandCooldown';\n\nexport { loadListeners } from './listeners/_load';\nexport { loadPreconditions } from './preconditions/_load';\n\ndeclare module 'discord.js' {\n\tinterface ClientOptions {\n\t\t/**\n\t\t * If Plugin-subcommand to load pre-included subcommand error event listeners that log any encountered errors to the {@link SapphireClient.logger} instance\n\t\t * @since 3.1.2\n\t\t * @default true\n\t\t */\n\t\tloadSubcommandErrorListeners?: boolean;\n\t\t/**\n\t\t * Sets the default cooldown time for all subcommands.\n\t\t * @remark This is separate from {@link ClientOptions.defaultCooldown} as it is only used for subcommands\n\t\t * @remark Note that for the `filteredCommands` option you have to provide it as\n\t\t * - For a subcommand without a group: `commandName.subcommandName` (e.g. `config.show`).\n\t\t * - For a subcommand with a group: `commandName.groupName.subcommandName` (e.g. `config.set.prefix`).\n\t\t * @since 5.1.0\n\t\t * @default \"No cooldown options\"\n\t\t */\n\t\tsubcommandDefaultCooldown?: CooldownOptions;\n\t}\n}\n\ndeclare module '@sapphire/framework' {\n\tinterface Preconditions {\n\t\tPluginSubcommandCooldown: SubcommandPreconditions.PluginSubcommandCooldownContext;\n\t}\n}\n\n/**\n * The preconditions specific to subcommands\n * @since 5.1.0\n * @deprecated - This will be replaced with a regular top level export of {@link PluginSubcommandCooldown}\n * in the next major version as opposed to a namespaced export.\n */\nexport const SubcommandPreconditions = {\n\tPluginSubcommandCooldown\n};\n\n/**\n * The preconditions specific to subcommands\n * @since 5.1.0\n * @deprecated - This will be replaced with a regular top level export of {@link PluginSubcommandCooldownPreconditionContext}\n * in the next major version as opposed to a namespaced export.\n */\nexport namespace SubcommandPreconditions {\n\t/** The context for the subcommand cooldown precondition */\n\texport type PluginSubcommandCooldownContext = PluginSubcommandCooldownPreconditionContext;\n}\n\n/**\n * The [@sapphire/plugin-subcommands](https://github.com/sapphiredev/plugins/blob/main/packages/subcommands) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '7.0.1-next.3b2c2df';\n"]}
@@ -13,7 +13,7 @@ export { loadPreconditions } from './preconditions/_load.mjs';
13
13
  var SubcommandPreconditions = {
14
14
  PluginSubcommandCooldown: PluginPrecondition
15
15
  };
16
- var version = "7.0.0";
16
+ var version = "7.0.1-next.3b2c2df";
17
17
 
18
18
  export { SubcommandPreconditions, version };
19
19
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"names":["PluginSubcommandCooldown"],"mappings":";;;;;;;;;;;;AAoDO,IAAM,uBAA0B,GAAA;AAAA,4BACtCA,kBAAA;AACD,EAAA;AAoBO,IAAM,OAAkB,GAAA","file":"index.mjs","sourcesContent":["import type { CooldownOptions } from '@sapphire/framework';\nimport {\n\tPluginPrecondition as PluginSubcommandCooldown,\n\ttype PluginSubcommandCooldownPreconditionContext\n} from './preconditions/PluginSubcommandCooldown';\n\nexport * from './lib/Subcommand';\nexport * as SubcommandPreconditionResolvers from './lib/precondition-resolvers/subcommandCooldown';\nexport * from './lib/types/Enums';\nexport * from './lib/types/Events';\nexport * from './lib/types/SubcommandMappings';\nexport {\n\tPluginPrecondition as PluginSubcommandCooldownPrecondition,\n\ttype PluginSubcommandCooldownPreconditionContext\n} from './preconditions/PluginSubcommandCooldown';\n\nexport { loadListeners } from './listeners/_load';\nexport { loadPreconditions } from './preconditions/_load';\n\ndeclare module 'discord.js' {\n\tinterface ClientOptions {\n\t\t/**\n\t\t * If Plugin-subcommand to load pre-included subcommand error event listeners that log any encountered errors to the {@link SapphireClient.logger} instance\n\t\t * @since 3.1.2\n\t\t * @default true\n\t\t */\n\t\tloadSubcommandErrorListeners?: boolean;\n\t\t/**\n\t\t * Sets the default cooldown time for all subcommands.\n\t\t * @remark This is separate from {@link ClientOptions.defaultCooldown} as it is only used for subcommands\n\t\t * @remark Note that for the `filteredCommands` option you have to provide it as\n\t\t * - For a subcommand without a group: `commandName.subcommandName` (e.g. `config.show`).\n\t\t * - For a subcommand with a group: `commandName.groupName.subcommandName` (e.g. `config.set.prefix`).\n\t\t * @since 5.1.0\n\t\t * @default \"No cooldown options\"\n\t\t */\n\t\tsubcommandDefaultCooldown?: CooldownOptions;\n\t}\n}\n\ndeclare module '@sapphire/framework' {\n\tinterface Preconditions {\n\t\tPluginSubcommandCooldown: SubcommandPreconditions.PluginSubcommandCooldownContext;\n\t}\n}\n\n/**\n * The preconditions specific to subcommands\n * @since 5.1.0\n * @deprecated - This will be replaced with a regular top level export of {@link PluginSubcommandCooldown}\n * in the next major version as opposed to a namespaced export.\n */\nexport const SubcommandPreconditions = {\n\tPluginSubcommandCooldown\n};\n\n/**\n * The preconditions specific to subcommands\n * @since 5.1.0\n * @deprecated - This will be replaced with a regular top level export of {@link PluginSubcommandCooldownPreconditionContext}\n * in the next major version as opposed to a namespaced export.\n */\nexport namespace SubcommandPreconditions {\n\t/** The context for the subcommand cooldown precondition */\n\texport type PluginSubcommandCooldownContext = PluginSubcommandCooldownPreconditionContext;\n}\n\n/**\n * The [@sapphire/plugin-subcommands](https://github.com/sapphiredev/plugins/blob/main/packages/subcommands) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '7.0.0';\n"]}
1
+ {"version":3,"sources":["../../src/index.ts"],"names":["PluginSubcommandCooldown"],"mappings":";;;;;;;;;;;;AAoDO,IAAM,uBAA0B,GAAA;AAAA,4BACtCA,kBAAA;AACD,EAAA;AAoBO,IAAM,OAAkB,GAAA","file":"index.mjs","sourcesContent":["import type { CooldownOptions } from '@sapphire/framework';\nimport {\n\tPluginPrecondition as PluginSubcommandCooldown,\n\ttype PluginSubcommandCooldownPreconditionContext\n} from './preconditions/PluginSubcommandCooldown';\n\nexport * from './lib/Subcommand';\nexport * as SubcommandPreconditionResolvers from './lib/precondition-resolvers/subcommandCooldown';\nexport * from './lib/types/Enums';\nexport * from './lib/types/Events';\nexport * from './lib/types/SubcommandMappings';\nexport {\n\tPluginPrecondition as PluginSubcommandCooldownPrecondition,\n\ttype PluginSubcommandCooldownPreconditionContext\n} from './preconditions/PluginSubcommandCooldown';\n\nexport { loadListeners } from './listeners/_load';\nexport { loadPreconditions } from './preconditions/_load';\n\ndeclare module 'discord.js' {\n\tinterface ClientOptions {\n\t\t/**\n\t\t * If Plugin-subcommand to load pre-included subcommand error event listeners that log any encountered errors to the {@link SapphireClient.logger} instance\n\t\t * @since 3.1.2\n\t\t * @default true\n\t\t */\n\t\tloadSubcommandErrorListeners?: boolean;\n\t\t/**\n\t\t * Sets the default cooldown time for all subcommands.\n\t\t * @remark This is separate from {@link ClientOptions.defaultCooldown} as it is only used for subcommands\n\t\t * @remark Note that for the `filteredCommands` option you have to provide it as\n\t\t * - For a subcommand without a group: `commandName.subcommandName` (e.g. `config.show`).\n\t\t * - For a subcommand with a group: `commandName.groupName.subcommandName` (e.g. `config.set.prefix`).\n\t\t * @since 5.1.0\n\t\t * @default \"No cooldown options\"\n\t\t */\n\t\tsubcommandDefaultCooldown?: CooldownOptions;\n\t}\n}\n\ndeclare module '@sapphire/framework' {\n\tinterface Preconditions {\n\t\tPluginSubcommandCooldown: SubcommandPreconditions.PluginSubcommandCooldownContext;\n\t}\n}\n\n/**\n * The preconditions specific to subcommands\n * @since 5.1.0\n * @deprecated - This will be replaced with a regular top level export of {@link PluginSubcommandCooldown}\n * in the next major version as opposed to a namespaced export.\n */\nexport const SubcommandPreconditions = {\n\tPluginSubcommandCooldown\n};\n\n/**\n * The preconditions specific to subcommands\n * @since 5.1.0\n * @deprecated - This will be replaced with a regular top level export of {@link PluginSubcommandCooldownPreconditionContext}\n * in the next major version as opposed to a namespaced export.\n */\nexport namespace SubcommandPreconditions {\n\t/** The context for the subcommand cooldown precondition */\n\texport type PluginSubcommandCooldownContext = PluginSubcommandCooldownPreconditionContext;\n}\n\n/**\n * The [@sapphire/plugin-subcommands](https://github.com/sapphiredev/plugins/blob/main/packages/subcommands) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '7.0.1-next.3b2c2df';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapphire/plugin-subcommands",
3
- "version": "7.0.0",
3
+ "version": "7.0.1-next.3b2c2df",
4
4
  "description": "Plugin for @sapphire/framework that adds support for subcommands.",
5
5
  "author": "@sapphire",
6
6
  "license": "MIT",