Skip to content

Instantly share code, notes, and snippets.

@lieuwex
Created May 20, 2016 20:45
Show Gist options
  • Save lieuwex/54ef8d66157e5b7b797d337a095eca6a to your computer and use it in GitHub Desktop.
Save lieuwex/54ef8d66157e5b7b797d337a095eca6a to your computer and use it in GitHub Desktop.
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