From 6730238f4ef52e6944930fe6f410f7185e96e90b Mon Sep 17 00:00:00 2001 From: AshGreninja Date: Tue, 11 Dec 2018 14:32:58 +0700 Subject: [PATCH 1/2] Update README.md --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 From e0b9582119941a5b4741d770ad7ae88d3dbe3dd2 Mon Sep 17 00:00:00 2001 From: AshGreninja Date: Tue, 11 Dec 2018 14:33:26 +0700 Subject: [PATCH 2/2] Update sample.php --- sample.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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();