botadmin.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:discordbot.py 作者: rauenzi 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号