@ -4,8 +4,9 @@ const responder = require('./responseHandler.js');
const validate =
(ctx, next) => {
if(!path(['update', 'message', 'from', 'id'], ctx)) return Promise.reject(ctx);
const fromId = path(['update', 'message', 'from', 'id'], ctx);
return ((ctx.update.message.from.id === config.masterID)
if(!fromId) return;
return ((fromId === config.masterID)
? Promise.resolve(ctx)
: Promise.reject(ctx))
.then(next)