Advertisement
Guest User

Untitled

a guest
Feb 9th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. import hexchat
  2. import re
  3. import smtplib
  4.  
  5. __module_name__ = "srl_bot"
  6. __module_version__ = "1.0"
  7. __module_description__ = "send srl emails"
  8.  
  9. def sendmail(message):
  10. try:
  11. smtp_ssl = smtplib.SMTP_SSL("smtp.gmail.com", 465)
  12. smtp_ssl.ehlo()
  13. smtp_ssl.login("username@gmail.com","password")
  14. smtp_ssl.sendmail("username@gmail.com","username@gmail.com","Subject: srl_bot race detection\n\n " + message)
  15. smtp_ssl.close()
  16. print("email sent")
  17. except:
  18. error = sys.exc_info()[0]
  19. print("email NOT sent: " + error)
  20.  
  21. def messageHandler(word, word_eol, userdata):
  22. if re.match(".*zelda2hacks.*",word[1]):
  23. #print(word[0] + " said " + word[1])
  24. sendmail(word[0] + " " + word[1])
  25. #hexchat.command("say z2hacks said " + word[0] + "!")
  26. return hexchat.EAT_NONE
  27.  
  28. hexchat.hook_print("Channel Message", messageHandler)
  29. hexchat.hook_print("Your Message", messageHandler)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement