跳到主要内容

get_recent_messages

获取指定聊天室的指定类型的最近的消息

声明

array get_recent_messages(object conn, string chat_type, string room_id, int start_id = 0, int count = -1, int register_time = 0)

参数

参数名描述
conn数据库客户端连接对象(通过ChatD.assure_connection获得)
chat_type消息类型
private_chat - 私聊消息
world_chat - 世界频道消息
user_chat - 留言消息
chatroom_chat - 聊天室消息
room_id聊天室ID
start_id获取的起始消息ID(消息ID大于start_id值的消息才会被获取,默认为0)
count获取的消息数量(-1表示获取所有消息,默认为-1)
register_time消息注册时间(消息注册时间大于等于register_time值的消息才会被获取,默认为0)

返回值

成功时返回消息列表,失败时返回nil

使用方式

返回文档