summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2014-03-17 01:00:22 +0100
committerlassulus <lassulus@googlemail.com>2014-03-17 01:00:22 +0100
commit0e6a8d12f55f5e8c1c5afb8f91ebcb5564590830 (patch)
tree4612342806c5f7332faae4a0b3f47cd842654ba2
parenta1980d18e89cc8f8d6b2598df55a888429bb7f06 (diff)
newsbot.js: check if name taken
-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]]