Delete Telegram messages PHP script - AARON SMITH TECH

Latest

Programming PHP tutorials for beginners. Technology and product reviews. Aaron Smith video tutorials for beginners.

sponsor

Tuesday, May 23, 2017

Delete Telegram messages PHP script



Delete Telegram messages PHP script

With telegram Api, you can delete one or all messages from group with Telegram bot.

Telegram bot delete message by chat id. With this script you can delete 1 message. To delete bulk telegram messages you can user Foreach php function. Telegram Bot cant delete messages from CHANNELS. You can delete messages if they was sent up to 48 hours. Set-up bot as Group administrator.
Numbers SMS receiving: https://www.facebook.com/proovl


$group_id = "******"; // telegram group ID
$botID = "*****"; // telegram bot ID
$message_id = "******"; // Telegram message ID

$url = "https://api.telegram.org/$botID/deleteMessage";

$postfields = array(
'chat_id' => $group_id,
'message_id' => "$message_id"
);

print_r($postfields);
if (!$curld = curl_init()) {
exit;
}

curl_setopt($curld, CURLOPT_POST, true);
curl_setopt($curld, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($curld, CURLOPT_URL,$url);
curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);

$output = curl_exec($curld);

curl_close ($curld);

Delete Telegram messages
You can get message id from telegram getupdates page.
Delete Telegram messages

https://www.facebook.com/chakabiz
https://www.youtube.com/channel/UCYuMRNb_SRZ4FMsZjnHRZUA

No comments:

Post a Comment