add opt get command

This commit is contained in:
hgw 2023-10-02 02:11:25 +00:00
parent 5f5c786ee3
commit 975c47246b

View File

@ -8,6 +8,7 @@ let parser = new Parser({
headers: {'User-Agent': config.feed.useragent}, headers: {'User-Agent': config.feed.useragent},
}); });
const editJsonFile = require("edit-json-file"); const editJsonFile = require("edit-json-file");
const { getDefaultHighWaterMark } = require('stream');
const timer = ms => new Promise(res => setTimeout(res, ms)) const timer = ms => new Promise(res => setTimeout(res, ms))
warningMsg = ''+config.colours.brackets+'['+config.colours.warning+'WARNING'+config.colours.brackets+']' warningMsg = ''+config.colours.brackets+'['+config.colours.warning+'WARNING'+config.colours.brackets+']'
@ -79,8 +80,16 @@ async function feed(nick, setting, value) {
} }
} }
async function get(setting) {
var file = editJsonFile('/home/node/app/config/default.json')
console.log(file.get(setting));
sendUpstream(file.get(setting))
}
if (setting === 'feed') { if (setting === 'feed') {
feed(user, setting2, value); feed(user, setting2, value);
} else if (setting === 'list') { } else if (setting === 'list') {
feed(user, setting2) feed(user, setting2)
} else if (setting === 'get') {
get(setting2);
} }