permissions.py 文件源码

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

项目:Chiaki-Nanami 作者: Ikusaba-san 项目源码 文件源码
def ignore(self, ctx, *channels_or_members: Plonkable):
        """Ignores text channels or members from using the bot.

        If no channel or member is specified, the current channel is ignored.
        """
        channels_or_members = channels_or_members or [ctx.channel]

        if len(channels_or_members) == 1:
            thing = one(channels_or_members)
            try:
                await ctx.session.add(Plonks(guild_id=ctx.guild.id, entity_id=thing.id))
            except asyncpg.UniqueViolationError:
                await ctx.send(f"I'm already ignoring {thing}...")
                raise commands.UserInputError

        else:
            await self._bulk_ignore_entries(ctx, channels_or_members)

        await self._display_plonked(ctx, channels_or_members, plonk=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号