From 96312303f0e8f14fbbf3cc995707d1e06a371762 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Wed, 12 Dec 2012 18:36:12 +0000 Subject: [PATCH] web config data now taken from dbot web config --- config.json.sample | 2 -- modules/poll/poll.js | 6 ++++-- modules/quotes/quotes.js | 4 ++-- modules/web/web.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config.json.sample b/config.json.sample index a7232d0..bda53b7 100644 --- a/config.json.sample +++ b/config.json.sample @@ -1,7 +1,5 @@ { "name": "testressionbot", - "webHost": "lolcathost", - "webPort": 80, "servers": { "freenode": { "server": "irc.freenode.net", diff --git a/modules/poll/poll.js b/modules/poll/poll.js index a2a6223..8c79a02 100644 --- a/modules/poll/poll.js +++ b/modules/poll/poll.js @@ -40,7 +40,8 @@ var poll = function(dbot) { } event.reply(dbot.t('poll_created', {'name': name, 'description': description, - 'url': dbot.t('url', {'host': dbot.webHost, 'port': dbot.webPort, 'path': 'polls/' + name})})); + 'url': dbot.t('url', {'host': dbot.config.web.webHost, + 'port': dbot.config.web.webPort, 'path': 'polls/' + name})})); } } }, @@ -141,7 +142,8 @@ var poll = function(dbot) { var name = event.input[1]; if(polls.hasOwnProperty(name)) { event.reply(dbot.t('poll_describe', {'name': name, 'description': polls[name].description, - 'url': dbot.t('url', {'host': dbot.webHost, 'port': dbot.webPort, 'path': 'polls/' + name})})); + 'url': dbot.t('url', {'host': dbot.config.web.webHost, 'port': + dbot.config.web.webPort, 'path': 'polls/' + name})})); } else { event.reply(dbot.t('poll_unexistent', {'name': name})); } diff --git a/modules/quotes/quotes.js b/modules/quotes/quotes.js index 772930e..49a7b71 100644 --- a/modules/quotes/quotes.js +++ b/modules/quotes/quotes.js @@ -189,8 +189,8 @@ var quotes = function(dbot) { var key = event.params[1].trim().toLowerCase(); if(quotes.hasOwnProperty(key)) { event.reply(dbot.t('quote_link', {'category': key, - 'url': dbot.t('url', {'host': dbot.webHost, - 'port': dbot.webPort, 'path': 'quotes/' + key})})); + 'url': dbot.t('url', {'host': dbot.config.web.webHost, + 'port': dbot.config.web.webPort, 'path': 'quotes/' + key})})); } else { event.reply(dbot.t('category_not_found', {'category': key})); } diff --git a/modules/web/web.js b/modules/web/web.js index 1be542a..af18b31 100644 --- a/modules/web/web.js +++ b/modules/web/web.js @@ -113,7 +113,7 @@ var webInterface = function(dbot) { } }); - app.listen(dbot.webPort); + app.listen(dbot.config.web.webPort); return { 'name': 'web',