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