mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[Mod] Make tempban not fail if no vanity url is set up (#4714)
* catch if a vanity url is not set up * black Co-authored-by: David Bauch <david.bauch@capgemini.com>
This commit is contained in:
parent
2b5d72c7a4
commit
d7a3da49f0
@ -39,7 +39,14 @@ class KickBanMixin(MixinMeta):
|
|||||||
if my_perms.manage_guild or my_perms.administrator:
|
if my_perms.manage_guild or my_perms.administrator:
|
||||||
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
|
||||||
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()
|
invites = await guild.invites()
|
||||||
else:
|
else:
|
||||||
invites = []
|
invites = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user