def cmd_unban(self, message, author, server, leftover_args):
"""
Usage: {command_prefix}unban [id] ["reason"]
Unbans the user(s) from the server, accepts a list of user ids with spaces between each
"""
if await self.has_roles(message.channel, author, server, command='unban'):
reason = None
if not leftover_args:
raise CommandError('Usage: {command_prefix}unban [id] ["reason"]\nForces the ID to be banned from a server')
try:
int(leftover_args[-1])
except:
try:
reason = leftover_args[-1]
del leftover_args[-1]
except TypeError:
raise CommandError('Please use a **USER ID** when using this command and not a name')
for id in leftover_args:
await self.unban(server, discord.Object(id=id))
await self.write_to_modlog(message, author, server, reason)
评论列表
文章目录