Telegram Shell. Remote access over Telegram bot API.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
447 B

const addListeners = (emitter, responder, ctx) => {
emitter.stdout.setEncoding('utf8');
emitter.stderr.setEncoding('utf8');
emitter.stdout.on('data', d => responder.success(d)(ctx));
emitter.stderr.on('data', e => responder.success(e)(ctx));
};
const removeListeners = emitter => {
emitter.stdout.removeAllListeners('data');
emitter.stderr.removeAllListeners('data');
};
module.exports = {
add: addListeners,
remove: removeListeners,
};