formapro/telegram-bot-php

DeleteMessage

Closed this issue · 1 comments

Can you show an example of deleteMessage usage? Thank you!

<?php
use Formapro\TelegramBot\Bot;
use Formapro\TelegramBot\Update;
use Formapro\TelegramBot\DeleteMessage;

$requestBody = file_get_contents('php://input'); 
$data = json_decode($requestBody, true);

$update = Update::create($data);

$bot = new Bot('telegramToken');
$bot->deleteMessage(new DeleteMessage(
    $update->getMessage()->getChat()->getId(), 
    $update->getMessage()->getMessageId()))