diff options
author | lassulus <lassulus@googlemail.com> | 2014-01-11 13:19:39 +0100 |
---|---|---|
committer | lassulus <lassulus@googlemail.com> | 2014-01-11 13:19:39 +0100 |
commit | f261e4db7600251607428f4d5316c9df72146fa2 (patch) | |
tree | c6e829f6a8267270c6dc7b7cf5c996d0ad8a03e4 | |
parent | a1a148adbc73e15f1731f4bb2fb22216ac002585 (diff) |
news: check for existing name
-rwxr-xr-x | news/controller.py | 11 |
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() |