Guest User

MadelineProto / @progerlive

a guest
Aug 7th, 2020
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.97 KB | None | 0 0
  1.         <?php
  2.  
  3.     if (!file_exists('madeline.php')) {
  4.         copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
  5.     }
  6.     include 'madeline.php';
  7.  
  8.     $MadelineProto = new \danog\MadelineProto\API('session.madeline');
  9.     $MadelineProto->start();
  10.  
  11.     $me = $MadelineProto->get_self();
  12.  
  13.     \danog\MadelineProto\Logger::log($me);
  14.  
  15.     if (!$me['bot']) {
  16.         $MadelineProto->messages->sendMessage(['peer' => '@danogentili', 'message' => "Hi!\nThanks for creating MadelineProto! <3"]);
  17.         $MadelineProto->channels->joinChannel(['channel' => '@MadelineProto']);
  18.  
  19.         try {
  20.             $MadelineProto->messages->importChatInvite(['hash' => 'https://t.me/joinchat/Bgrajz6K-aJKu0IpGsLpBg']);
  21.         } catch (\danog\MadelineProto\RPCErrorException $e) {
  22.         }
  23.  
  24.         $MadelineProto->messages->sendMessage(['peer' => 'https://t.me/joinchat/Bgrajz6K-aJKu0IpGsLpBg', 'message' => 'Testing MadelineProto!']);
  25.     }
  26.     echo 'OK, done!'.PHP_EOL;
Add Comment
Please, Sign In to add comment