Guest User

String to convert in Python

a guest
Aug 4th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.04 KB | None | 0 0
  1. <?php
  2. if (!file_exists('madeline.php')) {
  3.     copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
  4. }
  5. require_once 'madeline.php';
  6. class EventHandler extends \danog\MadelineProto\EventHandler
  7. {
  8.     public function onUpdateNewChannelMessage($update)
  9.     {
  10.         yield $this->onUpdateNewMessage($update);
  11.     }
  12.     public function onUpdateNewMessage($update)
  13.     {
  14.         if (isset($update['message']['out']) && $update['message']['out']) {
  15.             //comandi editMessage
  16.             $msg = $update['message']['message'];
  17.             if($msg === ".check"){
  18.                 yield $this->messages->editMessage(['peer' => $update, 'id' => $update['message']['id'], 'message' => "<b>Online✅</b>", 'parse_mode' => 'HTML']);
  19.             }
  20. //ONLINE
  21.             if($msg === ".on"){
  22.                 yield $this->account->updateProfile(['first_name' => 'sonomarco21', 'last_name' => '[ONLINE]', 'about' => '@Ninjalimitatibot +1 feed']);
  23.  
  24.                 yield $this->messages->editMessage(['peer' => $update, 'id' => $update['message']['id'], 'message' => "<b>ORA SEI ONLINE✅</b>", 'parse_mode' => 'HTML']);
  25.             }
  26.  
  27. //OFFLINE
  28. if($msg === ".off"){
  29. yield $this->account->updateProfile(['first_name' => 'sonomarco21', 'last_name' => '[OFFLINE]', 'about' => ' ']);
  30.  
  31.     yield $this->messages->editMessage(['peer' => $update, 'id' => $update['message']['id'], 'message' => "<b>ORA SEI OFFLINE❌</b>", 'parse_mode' => 'HTML']);
  32. }
  33.  
  34.  
  35.  
  36.  
  37.         //comandi normali inviati da utenti a ubot
  38.         $msg = $update['message']['message'];
  39.     }
  40. }
  41. $settings = [
  42.     'logger' => [
  43.         'logger_level' => 5
  44.     ],
  45.     'serialization' => [
  46.         'serialization_interval' => 30,
  47.         'cleanup_before_serialization' => true
  48.     ],
  49. ];
  50. $MadelineProto = new \danog\MadelineProto\API('session.madeline', $settings);
  51. $MadelineProto->async(true);
  52. $MadelineProto->loop(function () use ($MadelineProto) {
  53.     yield $MadelineProto->start();
  54.     yield $MadelineProto->setEventHandler('\EventHandler');
  55. });
  56. $MadelineProto->loop();
  57. ?>
  58.  
Add Comment
Please, Sign In to add comment