mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
Stop putting text about invite when invite isn't sent in tempban message (#3991)
This commit is contained in:
parent
12bce6a560
commit
4dd0fb97fe
@ -448,16 +448,14 @@ class KickBanMixin(MixinMeta):
|
|||||||
|
|
||||||
with contextlib.suppress(discord.HTTPException):
|
with contextlib.suppress(discord.HTTPException):
|
||||||
# We don't want blocked DMs preventing us from banning
|
# We don't want blocked DMs preventing us from banning
|
||||||
await user.send(
|
msg = _("You have been temporarily banned from {server_name} until {date}.").format(
|
||||||
_(
|
server_name=guild.name, date=unban_time.strftime("%m-%d-%Y %H:%M:%S")
|
||||||
"You have been temporarily banned from {server_name} until {date}. "
|
|
||||||
"Here is an invite for when your ban expires: {invite_link}"
|
|
||||||
).format(
|
|
||||||
server_name=guild.name,
|
|
||||||
date=unban_time.strftime("%m-%d-%Y %H:%M:%S"),
|
|
||||||
invite_link=invite,
|
|
||||||
)
|
)
|
||||||
|
if invite:
|
||||||
|
msg += _(" Here is an invite for when your ban expires: {invite_link}").format(
|
||||||
|
invite_link=invite
|
||||||
)
|
)
|
||||||
|
await user.send(msg)
|
||||||
try:
|
try:
|
||||||
await guild.ban(user, reason=reason, delete_message_days=days)
|
await guild.ban(user, reason=reason, delete_message_days=days)
|
||||||
except discord.Forbidden:
|
except discord.Forbidden:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user