Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (!file_exists('madeline.php')) {
- copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
- }
- require_once 'madeline.php';
- class EventHandler extends \danog\MadelineProto\EventHandler
- {
- public function onUpdateNewChannelMessage($update)
- {
- yield $this->onUpdateNewMessage($update);
- }
- public function onUpdateNewMessage($update)
- {
- if (isset($update['message']['out']) && $update['message']['out']) {
- //comandi editMessage
- $msg = $update['message']['message'];
- if($msg === ".check"){
- yield $this->messages->editMessage(['peer' => $update, 'id' => $update['message']['id'], 'message' => "<b>Online✅</b>", 'parse_mode' => 'HTML']);
- }
- //ONLINE
- if($msg === ".on"){
- yield $this->account->updateProfile(['first_name' => 'sonomarco21', 'last_name' => '[ONLINE]', 'about' => '@Ninjalimitatibot +1 feed']);
- yield $this->messages->editMessage(['peer' => $update, 'id' => $update['message']['id'], 'message' => "<b>ORA SEI ONLINE✅</b>", 'parse_mode' => 'HTML']);
- }
- //OFFLINE
- if($msg === ".off"){
- yield $this->account->updateProfile(['first_name' => 'sonomarco21', 'last_name' => '[OFFLINE]', 'about' => ' ']);
- yield $this->messages->editMessage(['peer' => $update, 'id' => $update['message']['id'], 'message' => "<b>ORA SEI OFFLINE❌</b>", 'parse_mode' => 'HTML']);
- }
- //comandi normali inviati da utenti a ubot
- $msg = $update['message']['message'];
- }
- }
- $settings = [
- 'logger' => [
- 'logger_level' => 5
- ],
- 'serialization' => [
- 'serialization_interval' => 30,
- 'cleanup_before_serialization' => true
- ],
- ];
- $MadelineProto = new \danog\MadelineProto\API('session.madeline', $settings);
- $MadelineProto->async(true);
- $MadelineProto->loop(function () use ($MadelineProto) {
- yield $MadelineProto->start();
- yield $MadelineProto->setEventHandler('\EventHandler');
- });
- $MadelineProto->loop();
- ?>
Add Comment
Please, Sign In to add comment