modlog.py 文件源码

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

项目:Chiaki-Nanami 作者: Ikusaba-san 项目源码 文件源码
def _set_actions(self, ctx, op, flags, *, colour):
        flags = unique(flags)

        config = await self._check_config(ctx)
        reduced = reduce(operator.or_, flags)
        config.events = op(config.events, reduced)

        await ctx.session.add(config)

        enabled_flags = ', '.join(f.name for f in ActionFlag if config.events & f)

        embed = (discord.Embed(colour=colour, description=', '.join(f.name for f in flags))
                 .set_author(name=f'Successfully {ctx.command.name}d the following actions')
                 .add_field(name='The following mod actions will now be logged',
                            value=enabled_flags, inline=False)
                 )

        await ctx.send(embed=embed)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号