Answer the question
In order to leave comments, you need to log in
How to delete a message in a telegram bot after clicking on any button?
switch ($callback_data) {
case 'Media':
$post = [
'chat_id' => $user_id,
'text' => 'Отлично, а теперь выбери нужный вопрос:',
'reply_markup' => inline_keyboard([
,
,
,
]),
];
telegram('sendMessage', $post);
break;}
Answer the question
In order to leave comments, you need to log in
https://core.telegram.org/bots/api#deletemessage
<?php
function deleteMessage($callback_query, $bot_api_key)
{
$apiUri = 'https://api.telegram.org/bot'.$bot_api_key.'/deleteMessage?'.
'&chat_id='.$callback_query->message->chat->id.
'&message_id='.$callback_query->message->message_id.
'';
return file_get_contents($apiUri);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question