Skip to content

Checking if user is suspended? #1074

Open
@Bitz

Description

@Bitz

I am trying to retweet tweets and follow the related user given the tweet ID but retweeting a tweet of a suspended user throws an error.

Is there a way to check if the user is suspended?

var toRt = _client.Tweets.GetTweetAsync(tweetId).Result;
if (!toRt.Retweeted)
{
    var tweet = _client.Tweets.PublishRetweetAsync(toRt).Result;
    _client.Users.FollowUserAsync(tweet.CreatedBy);
}

Currently, running var toRt = _client.Tweets.GetTweetAsync(tweetId).Result; throws the following Exception:

One or more errors occurred. (Reason : Forbidden
Details : User has been suspended. (63)
Code : 403
Date : 10/12/2020 11:21:10 PM -04:00
URL : https://api.twitter.com/1.1/statuses/show.json?id=1122955782138384384&tweet_mode=extended
Twitter documentation description : Forbidden - The request is understood, but it has been refused or access is not allowed. An accompanying error message will explain why. This code is used when requests are being denied due to update limits.
)

I would have expected the object to have the following property toRt.CreatedBy.IsSuspended but I'm guessing there's a different way to check if a user is suspended given the tweet context?

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions