From f261e4db7600251607428f4d5316c9df72146fa2 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 11 Jan 2014 13:19:39 +0100 Subject: news: check for existing name --- news/controller.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'news/controller.py') diff --git a/news/controller.py b/news/controller.py index cf032e65..4a8fd3bc 100755 --- a/news/controller.py +++ b/news/controller.py @@ -55,10 +55,13 @@ class NewsBot(irc.bot.SingleServerIRCBot): class commands(): def add(args): - bot = rssbot.RssBot(args[2], args[1], url_shortener=url_shortener) - bots[args[1]] = bot - bot.start() - return "bot " + args[1] + " added" + if args[1] not in bots: + bot = rssbot.RssBot(args[2], args[1], url_shortener=url_shortener) + bots[args[1]] = bot + bot.start() + return "bot " + args[1] + " added" + else: + return args[1] + ' does already exist' def delete(args): bots[args[1]].stop() -- cgit v1.2.3