From 1b3abcd0e37f2c3730ab05062f6b0275429a3522 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 9 Jan 2014 19:04:03 +0100 Subject: ircbot: search command --- ircbot/contoller.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ircbot/contoller.py b/ircbot/contoller.py index bf4dd578..59c3abb8 100755 --- a/ircbot/contoller.py +++ b/ircbot/contoller.py @@ -3,8 +3,7 @@ import irc.bot import _thread import rssbot import os - - +import subprocess class NewsBot(irc.bot.SingleServerIRCBot): def __init__(self, name, chans=['#news'], server='ire', port=6667, timeout=60): @@ -27,15 +26,10 @@ class NewsBot(irc.bot.SingleServerIRCBot): self.connection.privmsg(target, 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.sendq(event.source.nick, answer) + self.send(event.source.nick, answer) def on_pubmsg(self, connection, event): args_array = event.arguments[0].split() @@ -115,6 +109,9 @@ class commands(): else: return 'bot not found' + def search(args): + output = subprocess.check_output(['./GfindFeeds4bot', args[1]]).decode() + return output feedfile = 'new_feeds' url_shortener = 'http://wall' -- cgit v1.2.3