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