Fix everything (#927)
* Switch bearer token and endpoints, update parser * Enable user search, disable tweet search * Disable multi-user timelines for now * Fix parsing of pinned tombstone
This commit is contained in:
@@ -9,12 +9,12 @@ proc parseGraphUser*(json: string): User =
|
||||
|
||||
let raw = json.fromJson(GraphUser)
|
||||
|
||||
if raw.data.user.result.reason.get("") == "Suspended":
|
||||
if raw.data.userResult.result.unavailableReason.get("") == "Suspended":
|
||||
return User(suspended: true)
|
||||
|
||||
result = toUser raw.data.user.result.legacy
|
||||
result.id = raw.data.user.result.restId
|
||||
result.verified = result.verified or raw.data.user.result.isBlueVerified
|
||||
result = toUser raw.data.userResult.result.legacy
|
||||
result.id = raw.data.userResult.result.restId
|
||||
result.verified = result.verified or raw.data.userResult.result.isBlueVerified
|
||||
|
||||
proc parseGraphListMembers*(json, cursor: string): Result[User] =
|
||||
result = Result[User](
|
||||
|
||||
@@ -3,7 +3,7 @@ import user
|
||||
|
||||
type
|
||||
GraphUser* = object
|
||||
data*: tuple[user: UserData]
|
||||
data*: tuple[userResult: UserData]
|
||||
|
||||
UserData* = object
|
||||
result*: UserResult
|
||||
@@ -12,4 +12,4 @@ type
|
||||
legacy*: RawUser
|
||||
restId*: string
|
||||
isBlueVerified*: bool
|
||||
reason*: Option[string]
|
||||
unavailableReason*: Option[string]
|
||||
|
||||
Reference in New Issue
Block a user