From f0768b7253bc37434a8594d6f8a5acc033356085 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 19 Dec 2013 02:27:45 +0100 Subject: Reaktor/IRC: provide arguments to commands --- IRC/asybot.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'IRC') diff --git a/IRC/asybot.py b/IRC/asybot.py index d02a574..08cba0e 100755 --- a/IRC/asybot.py +++ b/IRC/asybot.py @@ -19,6 +19,7 @@ from sys import exit from re import split, search, match from textwrap import TextWrapper import logging,logging.handlers +import shlex config_filename = './config.py' @@ -145,6 +146,9 @@ class asybot(asychat): #TODO: allow only commands below ./commands/ exe = join(dirname(realpath(dirname(__file__))), command['argv'][0]) myargv = [exe] + command['argv'][1:] + print(match.groupdict()) + if 'args' in match.groupdict(): + myargv += shlex.split(match.groupdict()['args']) env = {} env['_from'] = prefix.split('!', 1)[0] -- cgit v1.2.3