Update twitter.py

This commit is contained in:
Luke Rogers 2014-03-19 17:40:21 +13:00
parent 4b7c8ffa75
commit e46cb5c826
1 changed files with 5 additions and 1 deletions

View File

@ -28,8 +28,10 @@ def get_api(bot):
@hook.regex(*TWITTER_RE)
def twitter_url(match, bot=None):
# Find the tweet ID from the URL
tweet_id = match.group(1)
# Get the tweet using the tweepy API
api = get_api(bot)
if not api:
return
@ -39,6 +41,7 @@ def twitter_url(match, bot=None):
except tweepy.error.TweepError:
return
# Format the return the text of the tweet
text = " ".join(tweet.text.split())
if user.verified:
@ -122,8 +125,9 @@ def twitter(inp, bot=None):
user = tweet.user
else:
# ???
return "Unknown Error"
return "Invalid Input"
# Format the return the text of the tweet
text = " ".join(tweet.text.split())
if user.verified: