Skip to content

Instantly share code, notes, and snippets.

@Polsaker
Created June 18, 2021 01:09
Show Gist options
  • Save Polsaker/2591f2200c0967652603cb9194a851d8 to your computer and use it in GitHub Desktop.
Save Polsaker/2591f2200c0967652603cb9194a851d8 to your computer and use it in GitHub Desktop.
Hexchat wallops window plugin
import hexchat
__module_name__ = "wallops_window"
__module_version__ = "1.0.0"
__module_description__ = "Sends wallops to their own buffer"
def handle_wallops(word, word_eol, userdata):
source: str = word[0]
msg: str = word[1]
formatted = f"\x0F-\x0329{source}/Wallops\x0F-\t{msg}"
print_to_context('>>Wallops<<', formatted)
return hexchat.EAT_HEXCHAT
# Stolen from A_Dragon
def print_to_context(name, msg):
context = hexchat.find_context(hexchat.get_info("network"), name)
if not context:
hexchat.command("QUERY -nofocus {}".format(name))
context = hexchat.find_context(hexchat.get_info("network"), name)
context.prnt(msg)
hexchat.hook_print('Receive Wallops', handle_wallops)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment