Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit b878e756534420a289dada09c11a9cb2ed67ca2f Author: Wim <wim@42.be> Date: Mon Sep 11 23:12:33 2017 +0000 Add partial support for deleted messages (telegram) diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go index 77a5f4e..937dfe9 100644 --- a/bridge/telegram/telegram.go +++ b/bridge/telegram/telegram.go @@ -686 +6818 @@ func (b *Btelegram) Send(msg config.Message) (string, error) {   msg.Text = makeHTML(msg.Text)   }   + if msg.Event == config.EVENT_MSG_DELETE { + if msg.ID == "" { + return "", nil + } + msgid, err := strconv.Atoi(msg.ID) + if err != nil { + return "", err + } + _, err = b.c.DeleteMessage(tgbotapi.DeleteMessageConfig{ChatID: chatid, MessageID: msgid}) + return "", err + } +   // edit the message if we have a msg ID   if msg.ID != "" {   msgid, err := strconv.Atoi(msg.ID)