summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--news/newsbot.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/news/newsbot.js b/news/newsbot.js
index 35587d39..73a6111b 100644
--- a/news/newsbot.js
+++ b/news/newsbot.js
@@ -186,8 +186,12 @@ function getShortLink (link, callback) {
var methods = {}
methods.add = function (params, callback) {
- create_feedbot(params[0], params[1], [news_channel])
- return callback(null)
+ if (slaves.hasOwnProperty(params[0])) {
+ return callback(new Error('name already taken'))
+ } else {
+ create_feedbot(params[0], params[1], [news_channel])
+ return callback(null)
+ }
}
methods.del = function (params, callback) {
var slave = slaves[params[0]]