From aa34d174eff2f0a64997f8924f13550904b7e7b1 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Sun, 22 Jul 2018 02:31:53 +0530 Subject: [PATCH] Add condition to exit --- webhook.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webhook.php b/webhook.php index d6422d0..e5783cf 100644 --- a/webhook.php +++ b/webhook.php @@ -48,6 +48,10 @@ $decoded = json_decode($var); // Store the chat ID $chat_id = $decoded->{"message"}->{"chat"}->{"id"}; +if (!isset($decoded->{"message"}->{"forward_from"})){ + exit(); +} + if ($decoded->{"message"}->{"forward_from"}->{"username"} != "chtwrsbot") { exit(); }