Skip to content

Commit

Permalink
update error check for suspended account on twitter
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishjh-bst committed Dec 29, 2023
1 parent 729ac0f commit 70d44eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion twitter/feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (p *Plugin) getTweetsForUser(username string, attempt int, delay time.Durat
if tweet.Error != nil {
errString := tweet.Error.Error()
isNotFound := strings.Contains(errString, "not found")
isSuspended := strings.Contains(errString, "User has been suspended")
isSuspended := strings.Contains(errString, "visibility-custom-suspension")
if isNotFound || isSuspended {
_, err := models.TwitterFeeds(models.TwitterFeedWhere.TwitterUsername.EQ(username)).UpdateAllG(context.Background(), models.M{"enabled": false})
if err != nil {
Expand Down

0 comments on commit 70d44eb

Please sign in to comment.