Created
May 20, 2016 20:45
-
-
Save lieuwex/54ef8d66157e5b7b797d337a095eca6a to your computer and use it in GitHub Desktop.
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 weechat | |
import re | |
name = "xander" | |
author = "Lieuwe Rooijakkers <lieuwerooijakkers@gmail.com> (http://www.lieuwe.xyz/)" | |
version = "0.1" | |
license = "MIT" | |
description = "XANDER XANDER XANDER XANDER" | |
shutdown_function = "" | |
charset = "" | |
weechat.register( | |
name, | |
author, | |
version, | |
license, | |
description, | |
shutdown_function, | |
charset | |
) | |
def msg_cb(data, buffer, date, tags, displayed, highlight, prefix, message): | |
match = re.match("^!xander (.+)$", message, re.IGNORECASE) | |
groups = match.groups() | |
if len(groups) == 0: | |
return weechat.WEECHAT_RC_OK | |
weechat.hook_process("say -v Xander '{}'".format(groups[0]), 0, "", "") | |
return weechat.WEECHAT_RC_OK | |
weechat.hook_print("", "", "!xander", 1, "msg_cb", "") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment