mirror of
https://github.com/reality/dbot.git
synced 2025-01-11 20:42:37 +01:00
added try/catch for no usage/string info, moved module load error back to default stringspace
This commit is contained in:
parent
fbf4242d66
commit
1f2c7fa835
@ -64,11 +64,5 @@
|
|||||||
"spanish": "Cerrado la categoría: {category}",
|
"spanish": "Cerrado la categoría: {category}",
|
||||||
"na'vi": "{category}ìri oel 'upxareti fmoli",
|
"na'vi": "{category}ìri oel 'upxareti fmoli",
|
||||||
"welsh": "Categori wedi cloi: {category}"
|
"welsh": "Categori wedi cloi: {category}"
|
||||||
},
|
|
||||||
"module_load_error": {
|
|
||||||
"english": "Failed to load module: {moduleName}",
|
|
||||||
"spanish": "No se pudó cargar el módulo: {moduleName}",
|
|
||||||
"na'vi": "Oeru Oel {moduleName}it sung.",
|
|
||||||
"welsh": "Wedi methu a llwytho modiwl: {moduleName}"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
8
run.js
8
run.js
@ -200,6 +200,7 @@ DBot.prototype.reloadModules = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load the module usage data
|
// Load the module usage data
|
||||||
|
try {
|
||||||
var usage = JSON.parse(fs.readFileSync(moduleDir + 'usage.json', 'utf-8'));
|
var usage = JSON.parse(fs.readFileSync(moduleDir + 'usage.json', 'utf-8'));
|
||||||
for(key in usage) {
|
for(key in usage) {
|
||||||
if(usage.hasOwnProperty(key)) {
|
if(usage.hasOwnProperty(key)) {
|
||||||
@ -210,8 +211,12 @@ DBot.prototype.reloadModules = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch(err) {
|
||||||
|
// Invalid or no usage info
|
||||||
|
}
|
||||||
|
|
||||||
// Load the module string data
|
// Load the module string data
|
||||||
|
try {
|
||||||
var strings = JSON.parse(fs.readFileSync(moduleDir + 'strings.json', 'utf-8'));
|
var strings = JSON.parse(fs.readFileSync(moduleDir + 'strings.json', 'utf-8'));
|
||||||
for(key in strings) {
|
for(key in strings) {
|
||||||
if(strings.hasOwnProperty(key)) {
|
if(strings.hasOwnProperty(key)) {
|
||||||
@ -222,6 +227,9 @@ DBot.prototype.reloadModules = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch(err) {
|
||||||
|
// Invalid or no string info
|
||||||
|
}
|
||||||
|
|
||||||
this.modules.push(module);
|
this.modules.push(module);
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
|
@ -5,6 +5,12 @@
|
|||||||
"na'vi": "Srake sweylu nga pamrel sivi: ",
|
"na'vi": "Srake sweylu nga pamrel sivi: ",
|
||||||
"welsh": "A oeddech chi'n feddwl: "
|
"welsh": "A oeddech chi'n feddwl: "
|
||||||
},
|
},
|
||||||
|
"module_load_error": {
|
||||||
|
"english": "Failed to load module: {moduleName}",
|
||||||
|
"spanish": "No se pudó cargar el módulo: {moduleName}",
|
||||||
|
"na'vi": "Oeru Oel {moduleName}it sung.",
|
||||||
|
"welsh": "Wedi methu a llwytho modiwl: {moduleName}"
|
||||||
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"english": "http://{host}:{port}/{path}"
|
"english": "http://{host}:{port}/{path}"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user