You are viewing a single comment's thread from:

RE: Hivejs开发实战指南

in #starnote21 days ago

从帐户历史中遍历获取

async function getToAuthorReplies(author, limit){
  //获取对作者的最新评论
  let replies = []
  let res = await hive.api.getAccountHistoryAsync(author, -1, limit)
  res.forEach(item => {
    if(item[1].op[0] == "comment" & item[1].op[1].parent_author == author){
      replies.push(item)
    }
  })
  return replies
}