feat: command_prefix

This commit is contained in:
DIYgod
2020-10-27 18:03:38 +08:00
parent 0c15dbc9bf
commit 37f9ca31eb
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -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,
};
+3
View File
@@ -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) {