From 980a6287f9195f30e77b6cb62e9438ea62ba63ac Mon Sep 17 00:00:00 2001 From: Mattia Mascarello Date: Fri, 26 Aug 2022 04:39:41 +0200 Subject: [PATCH] Added else clause and temp creation --- src/index.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/index.php b/src/index.php index ec90458..8f2c190 100644 --- a/src/index.php +++ b/src/index.php @@ -362,7 +362,10 @@ switch ($DATA["message"]["chat"]["id"]) { if (empty($ps)) { API("sendMessage", ["chat_id" => $DATA["message"]["chat"]["id"], "text" => "Devi citare una foto", "reply_to_message_id" => $DATA["message"]["message_id"]]); } - + else{ + if (!file_exists('temp')) { + mkdir('temp'); + } $fO=API("getFile", ["file_id" => $ps[count($ps)-1]["file_id"]]); $fu="https://api.telegram.org/file/".$GLOBALS["config"]["lgbt"]["TOKEN"]."/".$fO["result"]["file_path"]; @@ -383,7 +386,7 @@ switch ($DATA["message"]["chat"]["id"]) { imagejpeg($im,$filename); API("sendChatAction", ["chat_id" => $DATA["message"]["chat"]["id"], "action" => "upload_photo"]); API("sendPhoto", ["chat_id" => $DATA["message"]["chat"]["id"], "photo" => "https://webport.altervista.org/bots/telegram/lgbt/fetchTemp.php?id=". $io. "&int=" . random_int(0, 10000), "reply_to_message_id" => $DATA["message"]["message_id"]]); - + } } elseif ($t == ".inspire") { if (!moduleOn(".inspire", $DATA["message"]["chat"]["id"], $DATA, true)) break;