botadmin.py 文件源码

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

项目:discordbot.py 作者: rauenzi 项目源码 文件源码
def unplonk(self, ctx, *, member: discord.Member):
        """Unbans a user from using the bot.

        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, [])

        try:
            db.remove(member.id)
        except ValueError:
            await self.bot.responses.failure(message='%s is not banned from using the bot in this server.' % member)
        else:
            plonks[guild_id] = db
            await self.config.put('plonks', plonks)
            await self.bot.responses.success(message='%s has been unbanned from using the bot in this server.' % member)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号