Last active
April 2, 2021 06:14
-
-
Save mpijierro/05620548d2754cd408c0c485c239dd96 to your computer and use it in GitHub Desktop.
Get your own information from Telegram API with MadelineProto in Laravel
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\Telegram; | |
use App\Http\Controllers\Controller; | |
use danog\MadelineProto\API; | |
class MeController extends Controller | |
{ | |
private $madelineProto; | |
public function __invoke (){ | |
$settings = []; | |
$this->madelineProto = new API('session.madeline', $settings); | |
$this->madelineProto->async(true); | |
return $this->madelineProto->loop(function () { | |
return yield $this->madelineProto->getSelf(); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment