mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-26 23:14:38 +01:00
24 lines
797 B
PHP
24 lines
797 B
PHP
<?php
|
|
|
|
require 'vendor/autoload.php';
|
|
|
|
$MadelineProto = new \danog\MadelineProto\API('sessionf.madeline');
|
|
$me = $MadelineProto->start();
|
|
|
|
$me = $MadelineProto->get_self();
|
|
|
|
\danog\MadelineProto\Logger::log($me);
|
|
|
|
if (!$me['bot']) {
|
|
$MadelineProto->messages->sendMessage(['peer' => '@danogentili', 'message' => "Hi!\nThanks for creating MadelineProto! <3"]);
|
|
$MadelineProto->channels->joinChannel(['channel' => '@MadelineProto']);
|
|
|
|
try {
|
|
$MadelineProto->messages->importChatInvite(['hash' => 'https://t.me/joinchat/Bgrajz6K-aJKu0IpGsLpBg']);
|
|
} catch (\danog\MadelineProto\RPCErrorException $e) {
|
|
}
|
|
|
|
$MadelineProto->messages->sendMessage(['peer' => 'https://t.me/joinchat/Bgrajz6K-aJKu0IpGsLpBg', 'message' => 'Testing MadelineProto!']);
|
|
}
|
|
echo 'OK, done!'.PHP_EOL;
|