mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-29 11:06:10 +00:00
api/twitter: update no tweet error code
This commit is contained in:
parent
0d58fad580
commit
37efa035a2
|
@ -119,6 +119,10 @@ export default async function({ id, index, toGif, dispatcher }) {
|
|||
|
||||
let tweetTypename = tweet?.data?.tweetResult?.result?.__typename;
|
||||
|
||||
if (!tweetTypename) {
|
||||
return { error: "fetch.empty" }
|
||||
}
|
||||
|
||||
if (tweetTypename === "TweetUnavailable") {
|
||||
const reason = tweet?.data?.tweetResult?.result?.reason;
|
||||
switch(reason) {
|
||||
|
@ -133,10 +137,6 @@ export default async function({ id, index, toGif, dispatcher }) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!tweetTypename) {
|
||||
return { error: "link.invalid" }
|
||||
}
|
||||
|
||||
if (!["Tweet", "TweetWithVisibilityResults"].includes(tweetTypename)) {
|
||||
return { error: "content.post.unavailable" }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue