diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 38b5ed6ac..4d65f0583 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -226,7 +226,7 @@ class Command: if param.kind == param.VAR_POSITIONAL: raise RuntimeError() # break the loop if required: - raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param)) + raise MissingRequiredArgument(param) return param.default if consume_rest_is_special: diff --git a/discord/ext/commands/errors.py b/discord/ext/commands/errors.py index 5aa6d1649..07d38a228 100644 --- a/discord/ext/commands/errors.py +++ b/discord/ext/commands/errors.py @@ -68,8 +68,15 @@ class CommandNotFound(CommandError): class MissingRequiredArgument(UserInputError): """Exception raised when parsing a command and a parameter that is required is not encountered. + + Attributes + ----------- + param: str + The argument that is missing. """ - pass + def __init__(self, param): + self.param = param.name + super().__init__('{0.name} is a required argument that is missing.'.format(param)) class TooManyArguments(UserInputError): """Exception raised when the command was passed too many arguments and its