SHARE
TWEET

Untitled

a guest Mar 26th, 2020 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. use danog\MadelineProto\API;
  4. use danog\MadelineProto\EventHandler;
  5. use danog\MadelineProto\Exception;
  6. use danog\MadelineProto\Logger;
  7. use danog\MadelineProto\RPCErrorException;
  8.  
  9. if (\file_exists('vendor/autoload.php')) {
  10.     include 'vendor/autoload.php';
  11. } else {
  12.     if (!\file_exists('madeline.php')) {
  13.         \copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
  14.     }
  15.     include 'madeline.php';
  16. }
  17.  
  18. class MyEventHandler extends EventHandler
  19. {
  20.  
  21.     const ADMIN = "SonoACasaDaSolo"; // Change this
  22.  
  23.     public function getReportPeers()
  24.     {
  25.         return [self::ADMIN];
  26.     }
  27.  
  28.     public function onUpdateNewChannelMessage(array $update): \Generator
  29.     {
  30.         return $this->onUpdateNewMessage($update);
  31.     }
  32.  
  33.     public function onUpdateNewMessage(array $update): \Generator
  34.     {
  35.        
  36.         $res = \json_encode($update, JSON_PRETTY_PRINT);
  37.  
  38.             }
  39.         }
  40.    
  41.  
  42. $settings = [
  43.     'logger' => [
  44.         'logger_level' => Logger::VERBOSE
  45.     ],
  46.     'serialization' => [
  47.         'serialization_interval' => 30,
  48.     ],
  49. ];
  50.  
  51. $MadelineProto = new API('bot.madeline', $settings);
  52.  
  53. $MadelineProto->startAndLoop(MyEventHandler::class);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top