cli.py 文件源码

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

项目:bocco-api-python 作者: YUKAI 项目源码 文件源码
def messages(ctx,
             room_uuid,
             newer_than,
             older_than,
             limit,
             verbose):
    # type: (click.Context, str, int, int, int, bool) -> None
    """???????????????"""
    api = ctx.obj['api']
    messages = api.get_messages(uuid.UUID(room_uuid),
                                newer_than=newer_than,
                                older_than=older_than)
    template = u'{m[date]} {m[user][nickname]} {m[text]}'
    if verbose:
        template = u'''
{m[date]} {m[user][nickname]} {m[text]}
\tid: {m[id]}
\tunique_id: {m[unique_id]}
\tmedia: {m[media]}
\tmessage_type: {m[message_type]}
\tdictated: {m[dictated]}
'''.strip()
    for m in messages[-limit:]:
        click.echo(template.format(m=m))  # type: ignore
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号