jacob614

hexchat voice message script

Jun 16th, 2015
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.01 KB | None | 0 0
  1. import hexchat
  2.  
  3. __module_name__ = "voice message fix"
  4. __module_version__ = "1.0"
  5. __module_description__ = "adds + before nicks using voice messages"
  6.  
  7. def voice_message_fix(word, word_eol, userdata):
  8.     if len(word) > 3 and word[2][0] in ["+", "@"]:
  9.         for channel in hexchat.get_list("channels"):
  10.             if channel.network == hexchat.get_info("network") and channel.server == hexchat.get_info("server") and channel.channel == word[2][1:]:
  11.                 channel.context.emit_print("Channel Message", word[2][0] + word[0].split("!")[0][1:], word_eol[3][1:])
  12.                 return hexchat.EAT_HEXCHAT
  13.  
  14. def voice_message_command(word, word_eol, userdata):
  15.     hexchat.command("msg +{0} [+] {1}".format(hexchat.get_info("channel"), word_eol[1]))
  16.     #hexchat.emit_print("Your Message", "+" + hexchat.get_info("nick"), word_eol[1]) # need to ignore first message for this to work
  17.     return hexchat.EAT_HEXCHAT
  18.  
  19. hexchat.hook_server("PRIVMSG", voice_message_fix)
  20. hexchat.hook_command("vmsg", voice_message_command)
  21.  
  22. print("loaded voice message fix script")
Advertisement
Add Comment
Please, Sign In to add comment