Advertisement
Guest User

Untitled

a guest
May 4th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import supybot.utils as utils
  2. from supybot.commands import *
  3. import supybot.plugins as plugins
  4. import supybot.ircutils as ircutils
  5. import supybot.callbacks as callbacks
  6.  
  7. import twitter
  8.  
  9. class Twitt(callbacks.Plugin):
  10. """Add the help for "@plugin help Twitt" here
  11. This should describe *how* to use this plugin."""
  12.  
  13. def tweet(self, message):
  14. api = twitter.Api(username="nozzlebot", password="#####")
  15. status = api.PostUpdate(message)
  16.  
  17. def doPrivmsg(self, irc, msg):
  18. (recipients, text) = msg.args
  19. for channel in recipients.split(','):
  20. if irc.isChannel(channel):
  21. nick = msg.nick or irc.nick
  22. if nick == 'nozzlebot':
  23. self.tweet(text)
  24.  
  25. Class = Twitt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement