kikocis/Based-Agent public
Changesets · Branches · Tags · Compare
| Changeset | 8908510384cd2e758efa734fac44669aea7d2f0278843068d73af60219d7ed30 |
|---|---|
| Author | murrlincoln <65836530+murrlincoln@users.noreply.github.com> · 2024-10-28 07:42 -04:00 |
| Committer | GitHub <noreply@github.com> · 2024-10-28 07:42 -04:00 |
| Parents | f8ce768bcd12, 86b953e287d6 |
1 file changed
modified Based-Agent/twitter_utils.py +4 −4
| @@ -22,7 +22,7 @@ | ||
| 22 | 22 | try: |
| 23 | 23 | tweet = self.api.update_status(content) |
| 24 | 24 | return f"Successfully posted tweet with ID: {tweet.id}" |
| 25 | - except tweepy.TweepError as e: | |
| 25 | + except tweepy.TweepException as e: | |
| 26 | 26 | return f"Error posting tweet: {str(e)}" |
| 27 | 27 | |
| 28 | 28 | def read_mentions(self, count: int = 10) -> List[Dict]: |
| @@ -43,7 +43,7 @@ | ||
| 43 | 43 | 'user': mention.user.screen_name, |
| 44 | 44 | 'created_at': mention.created_at |
| 45 | 45 | } for mention in mentions] |
| 46 | - except tweepy.TweepError as e: | |
| 46 | + except tweepy.TweepException as e: | |
| 47 | 47 | return [{'error': str(e)}] |
| 48 | 48 | |
| 49 | 49 | def reply_to_tweet(self, tweet_id: str, content: str) -> str: |
| @@ -68,7 +68,7 @@ | ||
| 68 | 68 | auto_populate_reply_metadata=True |
| 69 | 69 | ) |
| 70 | 70 | return f"Successfully replied to tweet {tweet_id}" |
| 71 | - except tweepy.TweepError as e: | |
| 71 | + except tweepy.TweepException as e: | |
| 72 | 72 | return f"Error replying to tweet: {str(e)}" |
| 73 | 73 | |
| 74 | 74 | def search_tweets(self, query: str, count: int = 10) -> List[Dict]: |
| @@ -90,5 +90,5 @@ | ||
| 90 | 90 | 'user': tweet.user.screen_name, |
| 91 | 91 | 'created_at': tweet.created_at |
| 92 | 92 | } for tweet in tweets] |
| 93 | - except tweepy.TweepError as e: | |
| 93 | + except tweepy.TweepException as e: | |
| 94 | 94 | return [{'error': str(e)}] |
| No newline at the end of the file |