diff --git a/README.md b/README.md index 19cc347..f308454 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,22 @@ $bot->cmd('/whoami|!whoami', function () { return Bot::sendMessage($text, $options); }); +//simple promote command +$bot->cmd('/promote|!promote', function ($id) { + + $options = [ + 'chat_id' => '@TeleBotTester', + 'user_id' => $id, + 'can_delete_messages' => true, + 'can_invite_users' => true, + 'can_pin_messages' => true, + 'can_restrict_members' => true + ]; + + $result = Bot::promoteChatMember($options); + return Bot::sendMessage($result); +}); + $bot->run(); ``` Then run diff --git a/sample.php b/sample.php index 7cdbcff..87a1ee2 100644 --- a/sample.php +++ b/sample.php @@ -80,4 +80,20 @@ return Bot::answerInlineQuery($results, $options); }); +//simple promote command +$bot->cmd('/promote|!promote', function ($id) { + + $options = [ + 'chat_id' => '@TeleBotTester', + 'user_id' => $id, + 'can_delete_messages' => true, + 'can_invite_users' => true, + 'can_pin_messages' => true, + 'can_restrict_members' => true + ]; + + $result = Bot::promoteChatMember($options); + return Bot::sendMessage($result); +}); + $bot->run();