Make bot immortal.

This commit is contained in:
Ceda EI 2018-04-03 00:43:34 +05:30
parent dccbb354cd
commit c8cb807510
1 changed files with 5 additions and 0 deletions

View File

@ -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'};