diff --git a/lib/config.js b/lib/config.js index f2d55cb..90e1cec 100644 --- a/lib/config.js +++ b/lib/config.js @@ -10,4 +10,5 @@ module.exports = { telegram_token: process.env.TELEGRAM_TOEKN, telegram_chat_id: process.env.TELEGRAM_CHAT_ID, ftqq_sckey: process.env.FTQQ_SCKEY, + command_prefix: process.env.COMMAND_PREFIX, }; \ No newline at end of file diff --git a/lib/engines/utils.js b/lib/engines/utils.js index fbfd362..9a1c1f7 100644 --- a/lib/engines/utils.js +++ b/lib/engines/utils.js @@ -3,6 +3,9 @@ const config = require('../config'); const download = (command, callback) => { let retryTimes = config.retryTimes; + if (config.command_prefix) { + command = `${config.command_prefix} && ` + command; + } const dl = () => { exec(command, (err, stdout, stderr) => { if (err) {