aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/ext/commands/core.py2
-rw-r--r--discord/ext/commands/errors.py9
2 files changed, 9 insertions, 2 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index 38b5ed6a..4d65f058 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 5aa6d164..07d38a22 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