From c8cb807510bc80419e89b66d222914b751729db7 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Tue, 3 Apr 2018 00:43:34 +0530 Subject: [PATCH] Make bot immortal. --- webhook.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webhook.php b/webhook.php index f1d4323..480f760 100644 --- a/webhook.php +++ b/webhook.php @@ -211,8 +211,13 @@ function yes_or_no() // Kill yourself function kys() { global $decoded; + global $bot_name; $kys = file('kys.txt'); $random_kys = $kys[rand(0,count($kys)-1)]; + if ($decoded->{'message'}->{'reply_to_message'}->{'from'}->{'username'} == $bot_name){ + send_text("I can't be killed.", true); + return; + } if (isset($decoded->{'message'}->{'reply_to_message'})) { if (isset($decoded->{'message'}->{'reply_to_message'}->{'from'}->{'username'})){ $username = '@' . $decoded->{'message'}->{'reply_to_message'}->{'from'}->{'username'};