diff --git a/src/ClientMessages.php b/src/ClientMessages.php
index 2fcb4ef..5bea70c 100644
--- a/src/ClientMessages.php
+++ b/src/ClientMessages.php
@@ -26,7 +26,7 @@ class ClientMessages
*
*
*
- * For convenience, the first argument may contains a TelegramObject which contains
+ * For convenience, you may pass a TelegramObject to the first argument which contains
* messages.acceptUrlAuth method payload. It's fields will be sent as payload.
*
* @param mixed $messageId
@@ -79,7 +79,7 @@ class ClientMessages
*
*
*
- * For convenience, the first argument may contains a TelegramObject which contains
+ * For convenience, you may pass a TelegramObject to the first argument which contains
* messages.addChatUser method payload. It's fields will be sent as payload.
*
* @param mixed $chatId
@@ -107,7 +107,7 @@ class ClientMessages
*
*
*
- * For convenience, the first argument may contains a TelegramObject which contains
+ * For convenience, you may pass a TelegramObject to the first argument which contains
* messages.addChatUser method payload. It's fields will be sent as payload.
*
* @param mixed $hash
@@ -139,7 +139,7 @@ class ClientMessages
/**
* Clear recent stickers.
*
- * For convenience, the first argument may contains a TelegramObject which contains
+ * For convenience, you may pass a TelegramObject to the first argument which contains
* messages.clearRecentStickers method payload. It's fields will be sent as payload.
*
* @param bool|TelegramObject $attached
@@ -183,7 +183,7 @@ class ClientMessages
*
*
*
- * For convenience, the first argument may contains a TelegramObject which contains
+ * For convenience, you may pass a TelegramObject to the first argument which contains
* messages.createChat method payload. It's fields will be sent as payload.
*
* @param mixed $title
@@ -229,7 +229,7 @@ class ClientMessages
*
*
*
- * For convenience, the first argument may contains a TelegramObject which contains
+ * For convenience, you may pass a TelegramObject to the first argument which contains
* messages.deleteChatUser method payload. It's fields will be sent as payload.
*
* @param mixed $chatId
@@ -275,7 +275,7 @@ class ClientMessages
*
*
*
- * For convenience, the first argument may contains a TelegramObject which contains
+ * For convenience, you may pass a TelegramObject to the first argument which contains
* messages.deleteHistory method payload. It's fields will be sent as payload.
*
* @param mixed $peer
@@ -304,7 +304,7 @@ class ClientMessages
*
*
*
- * For convenience, the first argument may contains a TelegramObject which contains
+ * For convenience, you may pass a TelegramObject to the first argument which contains
* messages.deleteMessages method payload. It's fields will be sent as payload.
*
* @param mixed $id
@@ -328,7 +328,7 @@ class ClientMessages
/**
* Delete scheduled messages.
*
- * For convenience, the first argument may contains a TelegramObject which contains
+ * For convenience, you may pass a TelegramObject to the first argument which contains
* messages.deleteScheduledMessages method payload. It's fields will be sent as payload.
*
* @param mixed $peer
@@ -352,7 +352,7 @@ class ClientMessages
/**
* Edit the description of a group/supergroup/channel.
*
- * For convenience, the first argument may contains a TelegramObject which contains
+ * For convenience, you may pass a TelegramObject to the first argument which contains
* messages.editChatAbout method payload. It's fields will be sent as payload.
*
* @param mixed $peer
@@ -376,7 +376,7 @@ class ClientMessages
/**
* Make a user admin in a legacy group.
*
- * For convenience, the first argument may contains a TelegramObject which contains
+ * For convenience, you may pass a TelegramObject to the first argument which contains
* messages.editChatAdmin method payload. It's fields will be sent as payload.
*
* @param mixed $chatId
@@ -402,7 +402,7 @@ class ClientMessages
/**
* Edit the default banned rights of a channel/supergroup/group.
*
- * For convenience, the first argument may contains a TelegramObject which contains
+ * For convenience, you may pass a TelegramObject to the first argument which contains
* messages.editChatDefaultBannedRights method payload. It's fields will be sent as payload.
*
* @param mixed $peer
@@ -448,7 +448,7 @@ class ClientMessages
*
*
*
- * For convenience, the first argument may contains a TelegramObject which contains
+ * For convenience, you may pass a TelegramObject to the first argument which contains
* messages.sendMessage method payload. It's fields will be sent as payload.
*
* @param mixed $peer
@@ -477,7 +477,7 @@ class ClientMessages
*
*
*
- * For convenience, the first argument may contains a TelegramObject which contains
+ * For convenience, you may pass a TelegramObject to the first argument which contains
* messages.getPeerDialog method payload. It's fields will be sent as payload.
*
* @param int ...$peers
@@ -501,7 +501,7 @@ class ClientMessages
*
*
*
- * For convenience, the first argument may contains a TelegramObject which contains
+ * For convenience, you may pass a TelegramObject to the first argument which contains
* messages.getHistory method payload. It's fields will be sent as payload.
*
* @param array|TelegramObject $params
diff --git a/src/Commands/MultiSessionCommand.php b/src/Commands/MultiSessionCommand.php
index 6e415aa..4b61481 100644
--- a/src/Commands/MultiSessionCommand.php
+++ b/src/Commands/MultiSessionCommand.php
@@ -67,7 +67,7 @@ class MultiSessionCommand extends Command
$this->exportMigration($tableName, $user ?? null);
- $this->info('Migration file exported.');
+ $this->info('Migration file generated.');
}
/**
@@ -78,7 +78,7 @@ class MultiSessionCommand extends Command
*/
public function exportMigration(string $tableName, string $relation = null)
{
- if ($relation == null) {
+ if (is_null($relation)) {
$relation = 'App/User';
}
diff --git a/src/Commands/TelegramAccountLoginCommand.php b/src/Commands/TelegramAccountLoginCommand.php
index 1a083a2..80ef49b 100644
--- a/src/Commands/TelegramAccountLoginCommand.php
+++ b/src/Commands/TelegramAccountLoginCommand.php
@@ -41,7 +41,7 @@ class TelegramAccountLoginCommand extends Command
try {
MadelineProto::completePhoneLogin($code);
} catch (NeedTwoFactorAuthException $e) {
- $password = $this->ask("2FA Password (hint '{$e->account->hint}')");
+ $password = $this->secret("2FA Password (hint '{$e->account->hint}')");
MadelineProto::submit2FA($password);
} catch (SignUpNeededException $e) {
diff --git a/src/Factories/MadelineProtoFactory.php b/src/Factories/MadelineProtoFactory.php
index f48f635..9577b3c 100644
--- a/src/Factories/MadelineProtoFactory.php
+++ b/src/Factories/MadelineProtoFactory.php
@@ -45,10 +45,6 @@ class MadelineProtoFactory
*/
public function get($session, array $config = null)
{
- if (is_null($config)) {
- $config = config('telegram.settings');
- }
-
if (is_int($session)) {
$session = $this->database->table($this->table)->find($session);
@@ -64,11 +60,16 @@ class MadelineProtoFactory
* Generating MadelineProto (session) instance.
*
* @param string $sessionFile
- * @param array $config
+ * @param array|null $config if this parameter is null, then the config from telegram.php
+ * file will be used
* @return MadelineProto
*/
- public function make(string $sessionFile, array $config)
+ public function make(string $sessionFile, array $config = null)
{
+ if (is_null($config)) {
+ $config = config('telegram.settings');
+ }
+
if (!file_exists(storage_path("app/telegram/"))) {
mkdir(storage_path("app/telegram"), 0755);
}