From 37a71b86a2476460bc2831d35ffae0fa60d78ab6 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 13 Oct 2018 15:16:10 +0000 Subject: [PATCH] Adapt examples to madeline.php --- userbots/MadelineProto_bot.php | 11 ++++++++++- userbots/pipesbot.php | 11 ++++++++++- userbots/pwrtelegram_debug_bot.php | 12 +++++++++++- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/userbots/MadelineProto_bot.php b/userbots/MadelineProto_bot.php index 9353cf45..8add5291 100755 --- a/userbots/MadelineProto_bot.php +++ b/userbots/MadelineProto_bot.php @@ -11,7 +11,16 @@ You should have received a copy of the GNU General Public License along with Mad If not, see . */ -require '../vendor/autoload.php'; +if (!file_exists(__DIR__.'/../vendor/autoload.php')) { + echo 'You did not run composer update, using madeline.php'.PHP_EOL; + if (!file_exists('madeline.php')) { + copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php'); + } + include 'madeline.php'; +} else { + require_once 'vendor/autoload.php'; +} + $settings = []; $MadelineProto = false; diff --git a/userbots/pipesbot.php b/userbots/pipesbot.php index 8a986366..3b344cef 100755 --- a/userbots/pipesbot.php +++ b/userbots/pipesbot.php @@ -11,7 +11,16 @@ You should have received a copy of the GNU General Public License along with Mad If not, see . */ -require '../vendor/autoload.php'; +if (!file_exists(__DIR__.'/../vendor/autoload.php')) { + echo 'You did not run composer update, using madeline.php'.PHP_EOL; + if (!file_exists('madeline.php')) { + copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php'); + } + include 'madeline.php'; +} else { + require_once 'vendor/autoload.php'; +} + $settings = []; $MadelineProto = false; $uMadelineProto = false; diff --git a/userbots/pwrtelegram_debug_bot.php b/userbots/pwrtelegram_debug_bot.php index b317b348..d43d2f39 100755 --- a/userbots/pwrtelegram_debug_bot.php +++ b/userbots/pwrtelegram_debug_bot.php @@ -10,7 +10,17 @@ See the GNU Affero General Public License for more details. You should have received a copy of the GNU General Public License along with MadelineProto. If not, see . */ -require '../vendor/autoload.php'; + +if (!file_exists(__DIR__.'/../vendor/autoload.php')) { + echo 'You did not run composer update, using madeline.php'.PHP_EOL; + if (!file_exists('madeline.php')) { + copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php'); + } + include 'madeline.php'; +} else { + require_once 'vendor/autoload.php'; +} + $settings = []; include_once 'token.php';