diff --git a/src/index.php b/src/index.php index ff62e05..a8affed 100644 --- a/src/index.php +++ b/src/index.php @@ -1,4 +1,5 @@ eof()) { - $i++; - $file->next(); -} -if($i>1000000){ - $lines_to_strip=1000000-$i; - $new_file = new SplFileObject('tempmark.txt', 'w'); - foreach (new LimitIterator(new SplFileObject('markovdata.txt'), $line_to_strip) as $line) - $new_file->fwrite($line); - } -rename("tempmark.txt","markovdata.txt"); - beg: switch ($DATA["message"]["chat"]["id"]) { @@ -876,10 +863,10 @@ switch ($DATA["message"]["chat"]["id"]) { } elseif ($t == ".RWP") { if (!moduleOn(".RWP", $DATA["message"]["chat"]["id"], $DATA, true)) break; - $ch  =  curl_init(); - curl_setopt($ch,  CURLOPT_URL, $GLOBALS["config"]["lgbt"]["APIs"]["wikiRandom"]); - curl_setopt($ch,  CURLOPT_RETURNTRANSFER,  1); - $output  =  curl_exec($ch); + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $GLOBALS["config"]["lgbt"]["APIs"]["wikiRandom"]); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + $output = curl_exec($ch); curl_close($ch); API("sendMessage", [ "chat_id" => $DATA["message"]["chat"]["id"], "text" => /*json_decode(*/ @@ -1344,7 +1331,7 @@ switch ($DATA["message"]["chat"]["id"]) { askNameFirst($DATA); $u->status = "askName"; $u->save(); - //API("sendMessage", ["chat_id" => $DATA["message"]["chat"]["id"], "text" => "Il bot ti ricontatterà  appena non scriverai qualcosa sul gruppo.","reply_to_message_id"=>$DATA["message"]["message_id"]]); + //API("sendMessage", ["chat_id" => $DATA["message"]["chat"]["id"], "text" => "Il bot ti ricontatterà appena non scriverai qualcosa sul gruppo.","reply_to_message_id"=>$DATA["message"]["message_id"]]); break; case "opt-out":