all repos — dotfiles @ 7aea05e57ad97627f5907f1e8e220b61cc467254

my *nix dotfiles

weechat/gt.py (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
import weechat, re
# modifies the string about to be sent to the IRC server
# thus, not interfering with non-IRC buffer text like wee-slack

weechat.register(
    "gt.py", "icyphox", "1.0", "MIT", "greentexting like the hacker called 4chan", "", ""
)

def greentext_cb(data, modifier, modifier_data, string):
    return re.sub(r">(?! )", "\x033>", string)

weechat.hook_modifier("irc_out1_privmsg", "greentext_cb", "")