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.

12 lines
384 B

const path = (path, obj) => path.reduce((result, segment) => result && result[segment], obj);
const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args)));
const getText = ctx => path(['update', 'message', 'text'], ctx) || '';
const extractCommand = cmd => text => text.replace(`/${cmd}`, '').trim();
module.exports = {
path,
compose,
getText,
extractCommand,
};