1
# gozerbot/plugs/inform.py
5
""" prepend nick: to the output of a command. """
8
from gozerbot.commands import cmnds
9
from gozerbot.examples import examples
10
from gozerbot.plugins import plugins
11
from gozerbot.plughelp import plughelp
12
from gozerbot.tests import tests
16
plughelp.add('inform', 'inform <nick> the output of a command')
18
def handle_inform(bot, ievent):
20
""" prepend nick: to the output of command to another user """
23
nick, cmnd = ievent.rest.split(' ', 1)
25
ievent.missing('<nick> <command>')
28
event = copy.deepcopy(ievent)
30
event.onlyqueues = True
31
result = plugins.cmnd(bot, event)
34
ievent.reply("no result for %s" % cmnd)
37
ievent.reply("%s: " % nick, result, dot=True)
39
cmnds.add('inform', handle_inform, 'USER', threaded=True)
40
examples.add('inform', 'inform <nick> <command> .. inform <nick> the output of command', 'inform dunker version')
41
tests.add('inform dunker version', 'dunker')