Skip to content

Commit 456bd9e

Browse files
author
Apipol Sukgler
committed
remove importJSON that not pass coverage test
1 parent 04dd782 commit 456bd9e

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

src/bot/index.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,6 @@ class SuperScript {
4141
});
4242
}
4343

44-
importJSON(obj, callback) {
45-
if (typeof obj === 'string') {
46-
try {
47-
obj = JSON.parse(obj);
48-
} catch (error) {
49-
callback(err);
50-
}
51-
}
52-
Importer.importData(this.chatSystem, obj, callback);
53-
}
54-
5544
getUsers(callback) {
5645
this.chatSystem.User.find({}, 'id', callback);
5746
}
@@ -244,7 +233,6 @@ class SuperScriptInstance {
244233

245234
const defaultOptions = {
246235
mongoURI: 'mongodb://localhost/superscriptDB',
247-
importJSON: null,
248236
importFile: null,
249237
factSystem: {
250238
clean: false,
@@ -265,8 +253,6 @@ const defaultOptions = {
265253
* @param {Object} options - Any configuration settings you want to use.
266254
* @param {String} options.mongoURI - The database URL you want to connect to.
267255
* This will be used for both the chat and fact system.
268-
* @param {Object} options.importJSON - Use this if you want to re-import from JSON Object.
269-
* Otherwise SuperScript will use whatever it currently finds in the database.
270256
* @param {String} options.importFile - Use this if you want to re-import your parsed
271257
* '*.json' file. Otherwise SuperScript will use whatever it currently
272258
* finds in the database.
@@ -317,9 +303,6 @@ const setup = function setup(options = {}, callback) {
317303
if (options.importFile) {
318304
return bot.importFile(options.importFile, err => callback(err, bot));
319305
}
320-
if (options.importJSON) {
321-
return bot.importJSON(options.importJSON, err => callback(err, bot));
322-
}
323306
return callback(null, bot);
324307
});
325308
};

0 commit comments

Comments
 (0)