blacklists.py 文件源码

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

项目:Chiaki-Nanami 作者: Ikusaba-san 项目源码 文件源码
def unblacklist(self, ctx, server_or_user: _GuildOrUser, *, reason=''):
        """Removes either a server or a user from the blacklist."""

        if await ctx.bot.is_owner(server_or_user):
            return await ctx.send("You can't blacklist my sensei you baka...")

        async with ctx.db.get_session() as session:
            query = session.select.from_(Blacklist).where(Blacklist.snowflake == server_or_user.id)
            row = await query.first()
            if not row:
                return await ctx.send(f"{server_or_user} isn't blacklisted.")

            await session.remove(row)
            await self._show_blacklist_embed(ctx, 0x4CAF50, 'unblacklisted', _unblocked_icon,
                                             server_or_user, reason, datetime.datetime.utcnow())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号