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.

11 lines
331 B

const { path } = require('../util/index.js');
const config = require('../config.js');
const validate =
ctx => {
if(!path(['update', 'message', 'from', 'id'], ctx)) return Promise.reject(ctx);
return (ctx.update.message.from.id === config.masterID) ? Promise.resolve(ctx) : Promise.reject(ctx);
}
module.exports = validate;