Hi, I am looking to develop a simple bot which

will present the rules to new group members and they need to write /agree to actually get access to the group. Is this even possible? I got already a basic VPS with Python running and got some bot actually presenting the rules when message directly, but thats it

26 ответов

11 просмотров

there are couple ways to solve this

You can use join request links, and use approveChatJoinRequest when you receive the /agree command

T-Tt 🦄 ⭕️ Автор вопроса
T Tt 🦄 ⭕️
Is there a basic code tutorial to achieve this?

if You can use a library like PHPBot, you can check the below snippet. <?php require_once __DIR__ . "/vendor/autoload.php"; use kyle2142\PHPBot; use kyle2142\TelegramException; $content = file_get_contents("php://input"); $update = json_decode($content, TRUE); $bot = new PHPBot("123456:ADGIKBCTU"); if (array_key_exists("chat_join_request", $update)) { $bot->api->sendMessage([ "chat_id" => $update["chat_join_request"]["user_chat_id"], "text" => "rules message here", "reply_markup" => json_encode([ "inline_keyboard" => [ [ [ "text" => "/agree", "callback_data" => $update["chat_join_request"]["chat"]["id"] ] ] ] ]) ]); } if (array_key_exists("callback_query", $update)) { $bot->api->answerCallbackQuery([ "callback_query_id" => $update["callback_query"]["id"] ]); $bot->api->approveChatJoinRequest([ "chat_id" => $update["callback_query"]["data"], "user_id" => $update["callback_query"]["from"]["id"] ]); }

T-Tt 🦄 ⭕️ Автор вопроса
Воспоминания <last name><a href=></a>
if You can use a library like PHPBot, you can chec...

so I put this into a PHP file (same folder) along with PHPBot.php composer.json And run it with installed php parser?

T Tt 🦄 ⭕️
so I put this into a PHP file (same folder) along ...

будешь терпеть сидеть здесь колымага ебанная твоя мать шлюха

T Tt 🦄 ⭕️
so I put this into a PHP file (same folder) along ...

Checkout phptherightway.com if you have never used or just starting to use PHP.

Alexandra Grigoryeva
🤡🤡🤡

Ты вообще вафля сума сошел?

ʀᷢɪͥɴᷡᴋⷦᴜͧ ᴅͩᴀⷽᴡᷱɴᷡ  ‌
It is a good language lol.

ты на моем хую тусишься очком своим как дом при взрыве ты же понимаешь что твоя мамаша всем дает, она такая проебанная шлюха ,что уже не за деньги ебется, а за спасибо

T-Tt 🦄 ⭕️ Автор вопроса
ʀᷢɪͥɴᷡᴋⷦᴜͧ ᴅͩᴀⷽᴡᷱɴᷡ  ‌
Use python if you are starting

I just wanted to a quick working script I will teach myself the details if I need it 😂

ʀᷢɪͥɴᷡᴋⷦᴜͧ ᴅͩᴀⷽᴡᷱɴᷡ  ‌
Js is good

Будешь своей жопой крутить и будут тебя ебать всё туда

Stark  ‌‌
Attaboy

Тебе даже если вьeбать хуже не станет

Alexandra Grigoryeva
js - second shit

what languages do you like then

Похожие вопросы

Карта сайта