diff --git a/handlers/middlewares/removeChannelForwards.js b/handlers/middlewares/removeChannelForwards.js index d39166d..02f6cfb 100644 --- a/handlers/middlewares/removeChannelForwards.js +++ b/handlers/middlewares/removeChannelForwards.js @@ -18,7 +18,7 @@ const isChannelForward = R.pathEq( ); const fromAdmin = R.pathEq([ 'from', 'status' ], 'admin'); -const inGroup = ctx => ctx.chat.type.endsWith('group'); +const inGroup = ctx => ctx.chat?.type.endsWith('group'); const capturingGroups = R.tail; diff --git a/stores/user.js b/stores/user.js index b4fc50e..8beb820 100644 --- a/stores/user.js +++ b/stores/user.js @@ -168,6 +168,9 @@ const unwarn = ({ id }, warnQuery) => const nowarns = query => unwarn(query, {}); +const verifyCaptcha = ({ id }, captcha = true) => + User.update({ id }, { $set: { captcha } }); + module.exports = { admin, ban, @@ -182,5 +185,6 @@ module.exports = { unban, unwarn, updateUser, + verifyCaptcha, warn, };