summaryrefslogtreecommitdiffstats
path: root/ircbot
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2014-01-06 01:01:53 +0100
committerlassulus <lassulus@googlemail.com>2014-01-06 01:01:53 +0100
commit7b74930bdc5cce9a84634245de5c29cc7571b42a (patch)
treef794246656f5cd8e73281e25f1c81406f91787dc /ircbot
parentf2adb4ea677d0651b89b63a9c59e44ff87bd63d0 (diff)
ircbot: respond to query
Diffstat (limited to 'ircbot')
-rwxr-xr-xircbot/contoller.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/ircbot/contoller.py b/ircbot/contoller.py
index 7964708e..0b31f39c 100755
--- a/ircbot/contoller.py
+++ b/ircbot/contoller.py
@@ -35,9 +35,15 @@ class NewsBot(irc.bot.SingleServerIRCBot):
self.connection.privmsg(self.chan, line)
sleep(1)
+ def sendq(self, target, string):
+ for line in string.split('\n'):
+ self.connection.privmsg(target, line)
+ sleep(1)
+
def on_privmsg(self, connection, event):
+ args_array = event.arguments[0].split()
answer = self.read_message(args_array)
- self.send(answer)
+ self.sendq(event.source.nick, answer)
def on_pubmsg(self, connection, event):
args_array = event.arguments[0].split()