formapro / telegram-bot-php

PHP Telegram Bot.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DeleteMessage

ilienkors opened this issue · 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()))