|
14 | 14 | )
|
15 | 15 |
|
16 | 16 | import discord
|
| 17 | +from discord import InvalidArgument |
17 | 18 | from discord.ext.commands import Bot, BadArgument
|
18 | 19 |
|
19 | 20 | import re
|
@@ -662,7 +663,7 @@ def __init__(self, command_type, callback, name=None, description=None, options=
|
662 | 663 | op_type = _type
|
663 | 664 |
|
664 | 665 | if OptionType.any_to_type(op_type) is None:
|
665 |
| - raise discord.errors.InvalidArgument("Could not find a matching option type for parameter '" + str(op_type) + "'") |
| 666 | + raise InvalidArgument("Could not find a matching option type for parameter '" + str(op_type) + "'") |
666 | 667 | _ops.append(SlashOption(op_type, _name, op_desc, required=_val.default == inspect._empty))
|
667 | 668 | self.options = _ops
|
668 | 669 |
|
@@ -778,7 +779,7 @@ def name(self) -> str:
|
778 | 779 | @name.setter
|
779 | 780 | def name(self, value):
|
780 | 781 | if value is None:
|
781 |
| - raise discord.errors.InvalidArgument("You have to specify a name") |
| 782 | + raise InvalidArgument("You have to specify a name") |
782 | 783 | if not isinstance(value, str):
|
783 | 784 | raise WrongType("name", value, "str")
|
784 | 785 | if len(value) > 32 or len(value) < 1:
|
@@ -1046,7 +1047,7 @@ def __init__(self, callback, base_names, name, description=None, options=None, g
|
1046 | 1047 | if isinstance(base_names, str):
|
1047 | 1048 | base_names = [base_names]
|
1048 | 1049 | if len(base_names) > 2:
|
1049 |
| - raise discord.errors.InvalidArgument("subcommand groups are currently limited to 2 bases") |
| 1050 | + raise InvalidArgument("subcommand groups are currently limited to 2 bases") |
1050 | 1051 | if any([len(x) > 32 or len(x) < 1 for x in base_names]):
|
1051 | 1052 | raise InvalidLength("base_names", 1, 32)
|
1052 | 1053 | self.base_names = [format_name(x) for x in base_names]
|
|
0 commit comments