def softban(self, *, member : discord.Member):
"""Soft bans a member from the server.
A softban is basically banning the member from the server but
then unbanning the member as well. This allows you to essentially
kick the member while removing their messages.
To use this command you must have Ban Members permissions or have
the Bot Admin role. Note that the bot must have the permission as well.
"""
try:
await self.bot.ban(member)
await self.bot.unban(member.server, member)
except discord.Forbidden:
await self.bot.say('The bot does not have permissions to ban members.')
except discord.HTTPException:
await self.bot.say('Banning failed.')
else:
await self.bot.say('\U0001f44c')
评论列表
文章目录