summaryrefslogtreecommitdiffstats
path: root/ircbot/contoller.py
diff options
context:
space:
mode:
authortv <tv@nomic.retiolum>2014-01-06 01:00:19 +0100
committertv <tv@nomic.retiolum>2014-01-06 01:00:19 +0100
commit54cb85b9ae82fe89d717fd5ce3de028b12c7c2fd (patch)
tree7931a79725681f7cdde4d4bb3cdd162f5a4f5258 /ircbot/contoller.py
parent89317ee561297b3626fa86db4951187bf8bccea1 (diff)
parentf2adb4ea677d0651b89b63a9c59e44ff87bd63d0 (diff)
Merge branch 'master' of https://github.com/krebscode/painload
Diffstat (limited to 'ircbot/contoller.py')
-rwxr-xr-xircbot/contoller.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/ircbot/contoller.py b/ircbot/contoller.py
index b3938b63..7964708e 100755
--- a/ircbot/contoller.py
+++ b/ircbot/contoller.py
@@ -36,14 +36,15 @@ class NewsBot(irc.bot.SingleServerIRCBot):
sleep(1)
def on_privmsg(self, connection, event):
+ answer = self.read_message(args_array)
+ self.send(answer)
+
+ def on_pubmsg(self, connection, event):
args_array = event.arguments[0].split()
if args_array[0][:-1]==self.name:
answer = self.read_message(args_array[1:])
self.send(answer)
- def on_pubmsg(self, connection, event):
- self.on_privmsg(connection, event)
-
def read_message(self, args):
try:
if args[0] in [x for x in commands.__dict__.keys() if x.find('_')]:
@@ -125,7 +126,7 @@ class commands():
for data in ['title', 'link', 'updated']:
if data in bots[args[1]].feed.feed:
output_buffer += data + ': ' + bots[args[1]].feed.feed[data] + '\n'
- print(output_buffer)
+ output_buffer += 'lastnew: ' + bots[args[1]].lastnew.isoformat()
return output_buffer
else:
return 'bot not found'