summaryrefslogtreecommitdiffstats
path: root/ircbot/contoller.py
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2014-01-04 21:38:58 +0100
committerlassulus <lassulus@googlemail.com>2014-01-04 21:38:58 +0100
commit393abf180b6bfcf89ab8544ec691a97d840f0963 (patch)
tree3aff7112c72889d33fe6b11ca15a2ad856b87732 /ircbot/contoller.py
parent4015f025fa2321b0362aeb1ac1116cdddb89fad6 (diff)
ircbot: more (fancy) features
Diffstat (limited to 'ircbot/contoller.py')
-rwxr-xr-xircbot/contoller.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/ircbot/contoller.py b/ircbot/contoller.py
index 71d04536..9466343d 100755
--- a/ircbot/contoller.py
+++ b/ircbot/contoller.py
@@ -33,7 +33,11 @@ class NewsBot(irc.bot.SingleServerIRCBot):
args_array = event.arguments[0].split()
if args_array[0][:-1]==self.name:
answer = self.read_message(args_array[1:])
- self.connection.privmsg(self.chan, answer)
+ self.send(answer)
+
+ def send(self, string):
+ for line in string.split('\n'):
+ self.connection.privmsg(self.chan, line)
def on_pubmsg(self, connection, event):
@@ -63,7 +67,19 @@ class NewsBot(irc.bot.SingleServerIRCBot):
return "bots saved to " + feedfile
elif args[0] == 'caps':
- return "add del save caps"
+ return "add del save caps list"
+
+ elif args[0] == 'list':
+ output_buffer = ''
+ for bot in bots:
+ output_buffer += bot + ' url: ' + bots[bot].url + '\n'
+ return output_buffer
+
+ elif args[0] == 'info':
+ if args[1] in bots:
+ return 'title: ' + bots[args[1]].feed.feed.title + '\n' + 'size: ' + len(bots[args[1]].feed.entries)
+ else:
+ return 'bot not found'
else:
return "unknown command"