From 5bbdb529f1bed01e36c93cf68c6318f8e01f6661 Mon Sep 17 00:00:00 2001 From: GingerPlusPlus Date: Mon, 18 Mar 2019 19:05:16 +0100 Subject: [PATCH] Misc --- handlers/commands/fban.js | 3 +++ handlers/middlewares/updateUserData.js | 4 ++++ index.js | 2 ++ 3 files changed, 9 insertions(+) create mode 100644 handlers/commands/fban.js diff --git a/handlers/commands/fban.js b/handlers/commands/fban.js new file mode 100644 index 0000000..f4e5176 --- /dev/null +++ b/handlers/commands/fban.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./ban'); diff --git a/handlers/middlewares/updateUserData.js b/handlers/middlewares/updateUserData.js index cff4eb8..ae7d88e 100644 --- a/handlers/middlewares/updateUserData.js +++ b/handlers/middlewares/updateUserData.js @@ -10,6 +10,10 @@ const updateUserDataHandler = async (ctx, next) => { updateUser(ctx.message.forward_from); } + const { entities = [] } = ctx.message; + + await Promise.all(entities.map(({ user }) => user && updateUser(user))); + if (!ctx.from) return next(); const user = await updateUser(ctx.from); diff --git a/index.js b/index.js index c72561b..f351078 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,7 @@ 'use strict'; +process.chdir(__dirname); + // Utils const { logError } = require('./utils/log');