Created
June 18, 2021 01:09
-
-
Save Polsaker/2591f2200c0967652603cb9194a851d8 to your computer and use it in GitHub Desktop.
Hexchat wallops window plugin
This file contains 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 characters
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