summaryrefslogtreecommitdiffstats
path: root/news/controller.py
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2014-01-11 13:19:39 +0100
committerlassulus <lassulus@googlemail.com>2014-01-11 13:19:39 +0100
commitf261e4db7600251607428f4d5316c9df72146fa2 (patch)
treec6e829f6a8267270c6dc7b7cf5c996d0ad8a03e4 /news/controller.py
parenta1a148adbc73e15f1731f4bb2fb22216ac002585 (diff)
news: check for existing name
Diffstat (limited to 'news/controller.py')
-rwxr-xr-xnews/controller.py11
1 files changed, 7 insertions, 4 deletions
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()