Closed MicDG closed 1 year ago
Hi @MicDG In order to delete a message you need two things as I assume you have already checked:
With that method you will be able to delete just in case you are replying to a received message you. So I think it would be better defining something more "general" and then ovverride the method:
bool AsyncTelegram2::deleteMessage(const char* chatId, const char* messageId)
{
char payload[BUFFER_SMALL];
snprintf(payload, BUFFER_SMALL,
"{\"chat_id\":%lld,\"message_id\":%" INT32 "}",
chatId, messageId);
const bool result = sendCommand("deleteMessage", payload);
log_debug("%s", payload);
return result;
}
bool AsyncTelegram2::deleteMessage(const TBMessage &msg)
{
return deleteMessage(msg.chatId, msg.messageID);
}
That makes sense, should I make a pull request to add it to the library?
Yes, if you can.
Otherwise I will add in the next release.
Hello, just wondering if something like this could be added to delete a message:
Thank you very much!