mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-05 17:02:32 -05:00
[3.4] Fix error in tempban for guilds with unused vanity feature (#5472)
This commit is contained in:
@@ -40,7 +40,12 @@ class KickBanMixin(MixinMeta):
|
||||
if "VANITY_URL" in guild.features:
|
||||
# guild has a vanity url so use it as the one to send
|
||||
try:
|
||||
return await guild.vanity_invite()
|
||||
invite = await guild.vanity_invite()
|
||||
# `if` is needed to work around
|
||||
# https://github.com/Rapptz/discord.py/issues/7103
|
||||
# until we can use a version with the fix
|
||||
if invite.code is not None:
|
||||
return invite
|
||||
except discord.NotFound:
|
||||
# If a guild has the vanity url feature,
|
||||
# but does not have it set up,
|
||||
|
||||
Reference in New Issue
Block a user