summaryrefslogtreecommitdiffstats
path: root/bridge/telegram/telegram.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-09-11 23:12:33 +0200
committerWim <wim@42.be>2017-09-11 23:12:33 +0200
commit14490bea9fc997e2af3f285c8e86fd5424965a6d (patch)
treeaa99c8f95457656124952472765197871e5c43f4 /bridge/telegram/telegram.go
parent035297005115c65fd99b1960bd40af881964a5c3 (diff)
downloadmatterbridge-msglm-14490bea9fc997e2af3f285c8e86fd5424965a6d.tar.gz
matterbridge-msglm-14490bea9fc997e2af3f285c8e86fd5424965a6d.tar.bz2
matterbridge-msglm-14490bea9fc997e2af3f285c8e86fd5424965a6d.zip
Add partial support for deleted messages (telegram)
Diffstat (limited to 'bridge/telegram/telegram.go')
-rw-r--r--bridge/telegram/telegram.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go
index 77a5f4e8..937dfe9c 100644
--- a/bridge/telegram/telegram.go
+++ b/bridge/telegram/telegram.go
@@ -68,6 +68,18 @@ 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)