From ff72c587ac013f701539c9b72b2b732ad3826971 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Mon, 2 Apr 2018 13:51:13 +0530 Subject: [PATCH] Reorder exits --- webhook.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/webhook.php b/webhook.php index c95d487..3c35a41 100644 --- a/webhook.php +++ b/webhook.php @@ -215,11 +215,6 @@ fwrite($json, $var); fclose($json); $decoded = json_decode($var); -// If message is a reply, exit -if (isset($decoded->{"message"}->{"reply_to_message"})) { - exit(); -} - // Store the chat ID $chat_id = $decoded->{"message"}->{"chat"}->{"id"}; @@ -282,6 +277,10 @@ $modules = array( ) ); +if (!isset($decoded->{"message"}->{"text"})){ + exit(); +} + if (isset($decoded->{"message"}->{"pinned_message"})){ exit(); } @@ -294,8 +293,11 @@ foreach ($modules as $module ) { exit(); } } -if (!isset($decoded->{"message"}->{"text"})){ - exit(); + +// If message is a reply, exit +if (isset($decoded->{"message"}->{"reply_to_message"})) { + exit(); } + send_text(get_insults(), true); ?>