aboutsummaryrefslogtreecommitdiff
path: root/discord/ext/commands
diff options
context:
space:
mode:
authorthetimtoy <[email protected]>2021-06-27 20:38:07 -0700
committerGitHub <[email protected]>2021-06-27 23:38:07 -0400
commit3c2cf06e46e6135585e93e82d3063adbac1a1b02 (patch)
treefda9d2982a65b47b99dbe3b8ea28878a5f3c4f7e /discord/ext/commands
parentAdd disable_guild_select to utils.oauth_url() (diff)
downloaddiscord.py-3c2cf06e46e6135585e93e82d3063adbac1a1b02.tar.xz
discord.py-3c2cf06e46e6135585e93e82d3063adbac1a1b02.zip
[commands] Add attr and parameter "argument" to BadInviteArgument
Diffstat (limited to 'discord/ext/commands')
-rw-r--r--discord/ext/commands/converter.py2
-rw-r--r--discord/ext/commands/errors.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py
index 60be8c40..e0f79330 100644
--- a/discord/ext/commands/converter.py
+++ b/discord/ext/commands/converter.py
@@ -663,7 +663,7 @@ class InviteConverter(Converter[discord.Invite]):
invite = await ctx.bot.fetch_invite(argument)
return invite
except Exception as exc:
- raise BadInviteArgument() from exc
+ raise BadInviteArgument(argument) from exc
class GuildConverter(IDConverter[discord.Guild]):
diff --git a/discord/ext/commands/errors.py b/discord/ext/commands/errors.py
index ac973862..3a67bb46 100644
--- a/discord/ext/commands/errors.py
+++ b/discord/ext/commands/errors.py
@@ -377,8 +377,9 @@ class BadInviteArgument(BadArgument):
.. versionadded:: 1.5
"""
- def __init__(self):
- super().__init__('Invite is invalid or expired.')
+ def __init__(self, argument):
+ self.argument = argument
+ super().__init__(f'Invite "{argument}" is invalid or expired.')
class EmojiNotFound(BadArgument):
"""Exception raised when the bot can not find the emoji.