From 725f601c9b006cd774024464caf4529068eb17a9 Mon Sep 17 00:00:00 2001 From: Zed Date: Sat, 4 Mar 2023 00:46:44 +0100 Subject: [PATCH] Add missing error codes for unavailable tweets --- src/parser.nim | 2 +- src/types.nim | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parser.nim b/src/parser.nim index a491cea..977d579 100644 --- a/src/parser.nim +++ b/src/parser.nim @@ -301,7 +301,7 @@ proc parseGlobalObjects(js: JsonNode): GlobalObjects = proc parseStatus*(js: JsonNode): Tweet = with e, js{"errors"}: - if e.getError == tweetNotFound: + if e.getError in {tweetNotFound, tweetUnavailable, tweetCensored}: return result = parseTweet(js, js{"card"}) diff --git a/src/types.nim b/src/types.nim index 625dcb0..573fe8c 100644 --- a/src/types.nim +++ b/src/types.nim @@ -47,6 +47,8 @@ type forbidden = 200 badToken = 239 noCsrf = 353 + tweetUnavailable = 421 + tweetCensored = 422 User* = object id*: string