mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
[Mod] Send invite to user before softban
This commit is contained in:
parent
956668cea1
commit
fe8ae25e1b
@ -95,12 +95,17 @@ class Mod:
|
|||||||
channel = ctx.message.channel
|
channel = ctx.message.channel
|
||||||
can_ban = channel.permissions_for(server.me).ban_members
|
can_ban = channel.permissions_for(server.me).ban_members
|
||||||
author = ctx.message.author
|
author = ctx.message.author
|
||||||
|
try:
|
||||||
|
invite = await self.bot.create_invite(server, max_age=3600*24)
|
||||||
|
invite = "\nInvite: " + invite
|
||||||
|
except:
|
||||||
|
invite = ""
|
||||||
if can_ban:
|
if can_ban:
|
||||||
try:
|
try:
|
||||||
try: # We don't want blocked DMs preventing us from banning
|
try: # We don't want blocked DMs preventing us from banning
|
||||||
msg = await self.bot.send_message(user, "You have been banned and "
|
msg = await self.bot.send_message(user, "You have been banned and "
|
||||||
"then unbanned as a quick way to delete your messages.\n"
|
"then unbanned as a quick way to delete your messages.\n"
|
||||||
"You can now join the server again.")
|
"You can now join the server again.{}".format(invite))
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
await self.bot.ban(user, 1)
|
await self.bot.ban(user, 1)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user