Fix UserByRestId request

This commit is contained in:
Zed 2023-03-22 13:04:11 +01:00
parent a5826a3c3d
commit 482b2da015
1 changed files with 3 additions and 2 deletions

View File

@ -15,8 +15,9 @@ proc getGraphUser*(username: string): Future[User] {.async.} =
proc getGraphUserById*(id: string): Future[User] {.async.} =
if id.len == 0 or id.any(c => not c.isDigit): return
let
variables = """{"userId": "$1", "withSuperFollowsUserFields": true}""" % [id]
js = await fetchRaw(graphUserById ? {"variables": variables}, Api.userRestId)
variables = %*{"userId": id, "withSuperFollowsUserFields": true}
params = {"variables": $variables, "features": tweetFeatures}
js = await fetchRaw(graphUserById ? params, Api.userRestId)
result = parseGraphUser(js)
proc getGraphUserTweets*(id: string; after=""; replies=false): Future[Timeline] {.async.} =