diff --git a/bootstrap.php b/bootstrap.php index 6966cc8..7ba42cf 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -1,9 +1,14 @@ load(); + (new Dotenv\Dotenv($root))->load(); } diff --git a/server.php b/server.php index e963b9c..fec5a23 100644 --- a/server.php +++ b/server.php @@ -41,5 +41,5 @@ Example: exit; } -$client = new \TelegramSwooleClient\Client(); +$client = new \TelegramSwooleClient\Client($root); new TelegramSwooleClient\Server($client, $options); \ No newline at end of file diff --git a/src/Client.php b/src/Client.php index 7bf2764..9406e5f 100644 --- a/src/Client.php +++ b/src/Client.php @@ -11,9 +11,9 @@ class Client { /** * Client constructor. */ - public function __construct() + public function __construct($root) { - $sessionFile = __DIR__ . '/../session.madeline'; + $sessionFile = $root . '/session.madeline'; $config = Config::getInstance()->getConfig('telegram');