def plonk(self, ctx, *, member: discord.Member):
"""Bans a user from using the bot.
This bans a person from using the bot in the current server.
There is no concept of a global ban. This ban can be bypassed
by having the Manage Server permission.
To use this command you must have the Manage Server permission
or have a Bot Admin role.
"""
plonks = self.config.get('plonks', {})
guild_id = ctx.message.server.id
db = plonks.get(guild_id, [])
if member.id in db:
await self.bot.responses.failure(message='That user is already bot banned in this server.')
return
db.append(member.id)
plonks[guild_id] = db
await self.config.put('plonks', plonks)
await self.bot.responses.success(message='%s has been banned from using the bot in this server.' % member)
评论列表
文章目录