stats.py 文件源码

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

项目:apex-sigma 作者: lu-ci 项目源码 文件源码
def add_cmd_stat(db, cmd, message, args):
    if not message.author.bot:
        command_data = {
            'name': cmd.name,
        }
        for key in ['global', 'sfw', 'admin', 'partner', 'pmable']:
            command_data[key] = cmd.perm[key]
        if message.guild:
            channel_id = message.channel.id
            guild_id = message.guild.id
        else:
            channel_id = None
            guild_id = None
        stat_data = {
            'command': command_data,
            'args': args,
            'author': message.author.id,
            'channel': channel_id,
            'guild': guild_id,
            'timestamp': arrow.utcnow().timestamp
        }
        db.insert_one('CommandStats', stat_data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号