diff --git a/example-conf.yml b/example-conf.yml index 15ccadc..a58ddb3 100644 --- a/example-conf.yml +++ b/example-conf.yml @@ -254,6 +254,9 @@ plugins: # PyLink is running. - networks + # Ctcp plugin: handles basic CTCP replies (VERSION, etc). + - ctcp + # Oper commands plugin: Provides a subset of network management commands. # (KILL, JUPE, etc.) # Note: these commands will be made available to anyone who's opered on your diff --git a/plugins/ctcp.py b/plugins/ctcp.py new file mode 100644 index 0000000..1031131 --- /dev/null +++ b/plugins/ctcp.py @@ -0,0 +1,16 @@ +# ctcp.py: Handles basic CTCP requests. +import sys +import os +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import utils +from log import log + +def handle_ctcpversion(irc, source, args): + """ + Handles CTCP version requests. + """ + irc.msg(source, '\x01VERSION %s\x01' % irc.version(), notice=True) + +utils.add_cmd(handle_ctcpversion, '\x01version') +utils.add_cmd(handle_ctcpversion, '\x01version\x01')