diff --git a/redbot/cogs/mod/kickban.py b/redbot/cogs/mod/kickban.py index 3a52dd691..e843bff58 100644 --- a/redbot/cogs/mod/kickban.py +++ b/redbot/cogs/mod/kickban.py @@ -39,7 +39,14 @@ class KickBanMixin(MixinMeta): if my_perms.manage_guild or my_perms.administrator: if "VANITY_URL" in guild.features: # guild has a vanity url so use it as the one to send - return await guild.vanity_invite() + try: + return await guild.vanity_invite() + except discord.NotFound: + # If a guild has the vanity url feature, + # but does not have it set up, + # this prevents the command from failing + # and defaults back to another regular invite. + pass invites = await guild.invites() else: invites = []