mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 09:22:31 -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:
|
if "VANITY_URL" in guild.features:
|
||||||
# guild has a vanity url so use it as the one to send
|
# guild has a vanity url so use it as the one to send
|
||||||
try:
|
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:
|
except discord.NotFound:
|
||||||
# If a guild has the vanity url feature,
|
# If a guild has the vanity url feature,
|
||||||
# but does not have it set up,
|
# but does not have it set up,
|
||||||
|
|||||||
Reference in New Issue
Block a user