Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete_message #464

Open
A1apaco opened this issue Mar 25, 2024 · 0 comments
Open

delete_message #464

A1apaco opened this issue Mar 25, 2024 · 0 comments

Comments

@A1apaco
Copy link

A1apaco commented Mar 25, 2024

Hello! Couldn't figure out how to delete a message using callbackQuery?

message:

$bot->command('help', function ($message) use ($bot) {
$keyboard_delete_message = new \TelegramBot\Api\Types\Inline\InlineKeyboardMarkup([
[['text' => "Удалить сообщение", 'callback_data' => 'delete_message']]
]);
$rawBody = $bot->getRawBody();
$message_id = $message->getMessageId();
$answer = "Команды: /help - помощь\n".$rawBody."///".$message_id;
$temp_message = $bot->sendMessage($message->getFrom()->getId(), $answer, null, false, $message_id, $keyboard_delete_message);
});

callbackQuery:

$bot->callbackQuery(function ($message) use ($bot) {
...
elseif ($message->getData() == "delete_message")
{
/* $rawBody = $bot->getRawBody();
{
$str = "pre>".$rawBody."/pre>";
} */
$bot->deleteMessage(
$message->getChat()->getId(),
???
);
}
} `

rawBody:
"reply_to_message":{
"message_id":1405,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant