Created
October 24, 2017 21:53
-
-
Save libussa/877e19ad2589cc1d29e7d37ec58ed6b7 to your computer and use it in GitHub Desktop.
Revisions
-
libussa created this gist
Oct 24, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ import hexchat __module_name__ = 'Ignore Channel' __module_version__ = '0.5' __module_description__ = 'Later' #always ignore those channels channels2ignore = set(["#spam"]) channels2ignoreTMP = set([]) # add some channel to the temporary ignored list def ic(word, word_eol, userdata): global channels2ignoreTMP channels2ignoreTMP.add(hexchat.get_info("channel")) hexchat.prnt("Temporarily ignored channels: %s" % channels2ignoreTMP) # remove some channel from the temporary ignored list def icc(word, word_eol, userdata): global channels2ignoreTMP channels2ignoreTMP.discard(hexchat.get_info("channel")) hexchat.prnt("Temporarily ignored channels: %s" % channels2ignoreTMP) # clear the temporary ignored list def icclear(word, word_eol, userdata): global channels2ignoreTMP channels2ignoreTMP = set([]) hexchat.prnt("Temporarily ignored channels: %s" % channels2ignoreTMP) def channel2ignore_cb(word, word_eol, userdata): global channels2ignoreTMP if (hexchat.get_info("channel") in channels2ignore or hexchat.get_info("channel") in channels2ignoreTMP): hexchat.command("gui color 0") return hexchat.EAT_NONE hexchat.hook_print("Channel Message", channel2ignore_cb) hexchat.hook_print("Join", channel2ignore_cb) hexchat.hook_print("Part", channel2ignore_cb) hexchat.hook_print("Part with Reason", channel2ignore_cb) hexchat.hook_print("Channel Action", channel2ignore_cb) hexchat.prnt(__module_name__ + " V" + __module_version__ + " loaded!") hexchat.hook_command('ic', ic) hexchat.hook_command('icc', icc) hexchat.hook_command('icclear', icclear) # /ic to add the current channel to the temporary ignore list # /ic to remove the current channel from the temporary ignore list # /icclear to clear the temporary ignored list