track whether or not the twitter module has been authenticated

This commit is contained in:
Brian S. Stephan 2010-12-24 13:19:11 -06:00
parent 41a5c43284
commit d9b85f4364
1 changed files with 2 additions and 0 deletions

View File

@ -51,6 +51,7 @@ class Twitter(Module):
# create a default twitter API account, in case we never auth
self.twit = twitter.Api()
self.authed = False
def do(self, connection, event, nick, userhost, replypath, what, admin_unlocked):
"""
@ -104,6 +105,7 @@ class Twitter(Module):
# finally, create the twitter API object
self.twit = twitter.Api(self.consumer_key, self.consumer_secret, self.access_token['oauth_token'], self.access_token['oauth_token_secret'])
self.authed = True
return self.reply(connection, replypath, 'The bot is now logged in.')
def tweet_or_retweet_text(self, tweet, print_source=False):