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())
评论列表
文章目录