Created
March 31, 2021 07:18
-
-
Save mpijierro/dbf2fd224f7279e00984b01b33e875bb to your computer and use it in GitHub Desktop.
New session in Telegram with MadelineProto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Http\Controllers\Controller; | |
use App\Http\Controllers\MadelineTrait; | |
class TelegramSessionController extends Controller | |
{ | |
private $madelineProto; | |
public function __invoke () | |
{ | |
$settings = []; | |
$settings['authorization']['default_temp_auth_key_expires_in'] = 86400*7; | |
$this->madelineProto = new \danog\MadelineProto\API('session.madeline', $settings); | |
$this->madelineProto->async(true); | |
$this->madelineProto->loop(function () { | |
$response = yield $this->madelineProto->start(); | |
return; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment