mirror of
https://github.com/danog/laravel-madeline-proto.git
synced 2024-11-26 20:04:41 +01:00
commit
d0c6af04fd
@ -49,7 +49,7 @@ return [
|
||||
|
||||
'logger' => Logger::FILE_LOGGER,
|
||||
|
||||
'logger_param' => env('MP_LOGGER_PATH', storage_path('logs/madeline-proto.log')),
|
||||
'logger_param' => env('MP_LOGGER_PATH', storage_path('logs/madeline_proto_' . date('dmY') . '.log')),
|
||||
|
||||
],
|
||||
|
||||
|
@ -70,10 +70,6 @@ class MadelineProtoFactory
|
||||
$config = config('telegram.settings');
|
||||
}
|
||||
|
||||
if (!file_exists(storage_path("app/telegram/"))) {
|
||||
mkdir(storage_path("app/telegram"), 0755);
|
||||
}
|
||||
|
||||
$client = new API(storage_path("app/telegram/$sessionFile"), $config);
|
||||
|
||||
return new MadelineProto($client);
|
||||
|
@ -52,6 +52,8 @@ class MadelineProtoServiceProvider extends ServiceProvider
|
||||
if ($this->app->runningInConsole()) {
|
||||
$this->registerCommands();
|
||||
|
||||
$this->generateTelegramSessionFolder();
|
||||
|
||||
$this->publishes([
|
||||
__DIR__ . '/../config/telegram.php' => config_path('telegram.php')
|
||||
]);
|
||||
@ -71,6 +73,18 @@ class MadelineProtoServiceProvider extends ServiceProvider
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create telegram session folder at storage path.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function generateTelegramSessionFolder()
|
||||
{
|
||||
if (!file_exists(storage_path("app/telegram/"))) {
|
||||
mkdir(storage_path("app/telegram"), 0755);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user