3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-30 14:49:28 +01:00

Ctcp plugin: handles basic VERSION requests

Closes #236.
This commit is contained in:
James Lu 2016-06-15 11:31:40 -07:00
parent d362063e8a
commit 11bbbfba19
2 changed files with 19 additions and 0 deletions

View File

@ -254,6 +254,9 @@ plugins:
# PyLink is running. # PyLink is running.
- networks - networks
# Ctcp plugin: handles basic CTCP replies (VERSION, etc).
- ctcp
# Oper commands plugin: Provides a subset of network management commands. # Oper commands plugin: Provides a subset of network management commands.
# (KILL, JUPE, etc.) # (KILL, JUPE, etc.)
# Note: these commands will be made available to anyone who's opered on your # Note: these commands will be made available to anyone who's opered on your

16
plugins/ctcp.py Normal file
View File

@ -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')