TelegramBots / Telegram.Bot

.NET Client for Telegram Bot API
https://telegrambots.github.io/book
MIT License
3.17k stars 684 forks source link

Delete messages #471

Closed KisielewskiTomek closed 6 years ago

KisielewskiTomek commented 6 years ago

Is there any method to remove a message older than 48 hours using a bot?

Dragonsangel commented 6 years ago

There can be no method that can do that since the Telegram Bot API itself does not support it, as referenced here: https://core.telegram.org/bots/api#deletemessage

TomaszKisielewski commented 6 years ago

It's not good news :-( I know method #deletetemessage from BOT API :-) but I need to delete messages in private channels older then 48 h. But it is impossible - return json from Telegram: {"ok":false,"error_code":400,"description":"Bad Request: message can't be deleted"}