Eleirbag89 / TelegramBotPHP

A very simple PHP Telegram Bot API for sending messages.
http://eleirbag89.github.io/TelegramBotPHP
MIT License
814 stars 343 forks source link

send message form bot to friends #128

Closed saeed2922 closed 6 years ago

saeed2922 commented 6 years ago

i want to learn how this section work

untitled

this is a section of t.me/music

eMaurits commented 6 years ago

You can find more information on that subject in the telegram api docs here: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating Or check the readme for this code here: https://github.com/Eleirbag89/TelegramBotPHP#build-keyboards

saeed2922 commented 6 years ago

my problem is choose contact and send to him

Eleirbag89 commented 6 years ago

https://core.telegram.org/bots/api#inlinekeyboardbutton play with the _switch_inlinequery parameter

saeed2922 commented 6 years ago

i use it but not work

$option = array( array( $telegram->buildInlineKeyBoardButton('Callback 1', $url = '', $callback_data = '1', $switch_inline_query= 'true'))); $keyb = $telegram->buildInlineKeyBoard($option); $content =array('chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => 'This is an InlineKeyboard Test with Callbacks');

NextGenZ commented 6 years ago

@saeed2922 If you are using it without Webhook You need to specify the chat_id if u are using Webhooks u need to declare chat_id as $chat_id = $telegram->ChatID();