forked from GitHub/dbot
fix error on ~link when web is misconfigured/not loaded
This commit is contained in:
parent
8d8cf2bd9a
commit
4a8e5d0cc0
@ -194,6 +194,8 @@ var commands = function(dbot) {
|
||||
'~link': function(event) {
|
||||
var key = event.input[1].toLowerCase();
|
||||
if(_.has(quotes, key)) {
|
||||
if(_.has(dbot.config, 'web') && _.has(dbot.config.web, 'webHost') &&
|
||||
_.has(dbot.config.web, 'webPort')) {
|
||||
event.reply(dbot.t('quote_link', {
|
||||
'category': key,
|
||||
'url': dbot.t('url', {
|
||||
@ -202,6 +204,9 @@ var commands = function(dbot) {
|
||||
'path': 'quotes/' + encodeURIComponent(key)
|
||||
})
|
||||
}));
|
||||
} else {
|
||||
event.reply(dbot.t('web_not_configured'));
|
||||
}
|
||||
} else {
|
||||
event.reply(dbot.t('category_not_found', { 'category': key }));
|
||||
}
|
||||
|
@ -126,5 +126,8 @@
|
||||
"rm_cache_limit": {
|
||||
"en": "Attention: Too many quotes removed, rmCache must be cleared or reinstated manually with ~rmconfirm or ~rmdeny.",
|
||||
"na'vi": "Oel zerok 'upxareti apxay set, sweylu txo nga 'aivku upxareti ìlä ~rmconfirm fu ~rmdeny."
|
||||
},
|
||||
"web_not_configured": {
|
||||
"en": "Cannot link to category. Web module is either not loaded or misconfigured."
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user