From 84e1a1fe5ac02ef6b759c3261b7daefb22550228 Mon Sep 17 00:00:00 2001 From: neersighted Date: Mon, 2 Apr 2012 09:32:21 -0700 Subject: [PATCH] Added actual data to CTCP TIME/FINGER --- plugins/ctcp.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/ctcp.py b/plugins/ctcp.py index 800115b..83ea55e 100755 --- a/plugins/ctcp.py +++ b/plugins/ctcp.py @@ -1,22 +1,27 @@ +# Plugin by neersighted +import time +import getpass from util import hook # CTCP responses @hook.regex(r'^\x01VERSION\x01$') -def ctcpversion(inp, notice=None): +def ctcp_version(inp, notice=None): notice('\x01VERSION: CloudBot - http://git.io/cloudbotirc') @hook.regex(r'^\x01PING\x01$') -def ctcpping(inp, notice=None): +def ctcp_ping(inp, notice=None): notice('\x01PING: PONG') @hook.regex(r'^\x01TIME\x01$') -def ctcptime(inp, notice=None): - notice('\x01TIME: GET A WATCH') +def ctcp_time(inp, notice=None): + the_time = time.strftime("%r", time.localtime()) + notice('\x01TIME: The time is: ' + the_time) @hook.regex(r'^\x01FINGER\x01$') -def ctcpfinger(inp, notice=None): - notice('\x01FINGER: WHERE ARE YOU PUTTING THAT') +def ctcp_finger(inp, notice=None): + user = getpass.getuser() + notice('\x01FINGER: Username is: ' + user)