diff --git a/CHANGELOG.md b/CHANGELOG.md index 59647db..ecc9be0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - ### **New handling features** - Tokens are now automatically prefixed with the required keyword that designates bot accounts (Phasing out of Eris in the future) +- The dynamic argument parser now specifically looks for numbers in IDs rather than any character ### **Bug fixes** - Fixed an issue where a 401 error would occur on using the Agent's connect method diff --git a/lib/modules/command-handler/index.js b/lib/modules/command-handler/index.js index d07be18..c56d93d 100644 --- a/lib/modules/command-handler/index.js +++ b/lib/modules/command-handler/index.js @@ -45,8 +45,8 @@ class CommandHandler extends BaseHandler { this._regexes = { escapables: /[.*+?^${}()|[\]\\]/g, dynamics: { - user: /<@!?(.+?)>/, - channel: /<#(.+?)>/ + user: /<@!?(\d+)>/, + channel: /<#(\d+)>/ } } @@ -398,9 +398,10 @@ class CommandHandler extends BaseHandler { /** * Parse a dynamic arg (Either a mention or name) - * @param {Eris.Guild} guild The guild the target is in - * @param {String} arg The argument - * @param {String} type The type of arg (user, channel) + * @private + * @param {Eris.Guild} guild The guild the target is in + * @param {String} arg The argument + * @param {String} type The type of arg (user, channel) */ _parseDynArg (guild, arg, type) { const container = type === 'user' ? this._client.users : guild.channels @@ -485,6 +486,7 @@ class CommandHandler extends BaseHandler { /** * Normalize a message's content + * @private * @param {String} msg The subject message * @returns {Normalized} The processed content */ diff --git a/lib/modules/reaction-handler/index.js b/lib/modules/reaction-handler/index.js index 69143b1..665ed11 100644 --- a/lib/modules/reaction-handler/index.js +++ b/lib/modules/reaction-handler/index.js @@ -227,7 +227,8 @@ class ReactionHandler extends BaseHandler { /** * Load a reaction command - * @param {ReactCommand} reactCommand The reaction command to load + * @private + * @param {ReactCommand} reactCommand The reaction command to load */ _loadReactCommand (reactCommand) { if (!(reactCommand instanceof ReactCommand)) throw TypeError('Supplied react command not a ReactCommand instance:\n' + reactCommand)