From cbdac3c48e93bb9421166f58e22da3da818e9f24 Mon Sep 17 00:00:00 2001 From: Pouria Ezzati Date: Thu, 28 Sep 2017 15:41:36 +0330 Subject: [PATCH] don't try to delete private messages --- handlers/middlewares/middleware.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/handlers/middlewares/middleware.js b/handlers/middlewares/middleware.js index 51c8c9e..74578d1 100644 --- a/handlers/middlewares/middleware.js +++ b/handlers/middlewares/middleware.js @@ -17,7 +17,8 @@ const middlewareHandler = async ({ chat, from, message, reply }, next) => { message && message.text && message.text[0] === '/' && - message.text[1].match(/\w/) + message.text[1].match(/\w/) && + chat.type !== 'private' ) { try { await bot.telegram.deleteMessage(chat.id, message.message_id);