[commands] Add attr and parameter "argument" to BadInviteArgument

This commit is contained in:
thetimtoy 2021-06-27 20:38:07 -07:00 committed by GitHub
parent dbb135b81a
commit 3c2cf06e46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -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]):

View File

@ -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.