def lossless_announce_cb(word, word_eol, userdata):
#print "%s was kicked from %s (%s)" % (word[3], word[2], word_eol[4])
# Don't eat this event, let other plugins and xchat see it too
import fnmatch
#return xchat.EAT_NONE
nick = word[0].split("!")
nick = nick[0].replace(":", "", 1)
if word[2] == "" and nick == "":
release = word_eol[3].replace(":", "", 1)
list2 = xchat.get_list("channels")
for i in list2:
if i.channel == "#lossless-help" and i.server == "irc.oink.me.uk" and i.type == 2:
ctx = i.context
break
if (fnmatch.fnmatch(release, "*/*/Lossless]*")) == True:
ctx.command("say %s"% (release))
xchat.hook_server("PRIVMSG", lossless_announce_cb)