diff options
author | Wim <wim@42.be> | 2021-12-10 22:13:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-10 22:13:54 +0100 |
commit | 658bdd9faa835660ae407331732e9d93d8f6443b (patch) | |
tree | ee198e677d29cd7cd89317b2fad65b6aaa080497 | |
parent | e1eebcd4e0d6fd491fb6096432cdc75805558469 (diff) | |
download | matterbridge-msglm-658bdd9faa835660ae407331732e9d93d8f6443b.tar.gz matterbridge-msglm-658bdd9faa835660ae407331732e9d93d8f6443b.tar.bz2 matterbridge-msglm-658bdd9faa835660ae407331732e9d93d8f6443b.zip |
Fix telegram/handlers.go linting (#1658)
-rw-r--r-- | bridge/telegram/handlers.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go index 7f40ddc9..3292e058 100644 --- a/bridge/telegram/handlers.go +++ b/bridge/telegram/handlers.go @@ -436,7 +436,7 @@ func (b *Btelegram) handleEntities(rmsg *config.Message, message *tgbotapi.Messa return } - var indexMovedBy = 0 + indexMovedBy := 0 // for now only do URL replacements for _, e := range *message.Entities { @@ -456,14 +456,14 @@ func (b *Btelegram) handleEntities(rmsg *config.Message, message *tgbotapi.Messa } if e.Type == "code" { - var offset = e.Offset + indexMovedBy - rmsg.Text = rmsg.Text[:offset] + "`" + rmsg.Text[offset:offset + e.Length] + "`" + rmsg.Text[offset + e.Length :] + offset := e.Offset + indexMovedBy + rmsg.Text = rmsg.Text[:offset] + "`" + rmsg.Text[offset:offset+e.Length] + "`" + rmsg.Text[offset+e.Length:] indexMovedBy += 2 } if e.Type == "pre" { - var offset = e.Offset + indexMovedBy - rmsg.Text = rmsg.Text[:offset] + "```\n" + rmsg.Text[offset:offset + e.Length] + "\n```" + rmsg.Text[offset + e.Length :] + offset := e.Offset + indexMovedBy + rmsg.Text = rmsg.Text[:offset] + "```\n" + rmsg.Text[offset:offset+e.Length] + "\n```" + rmsg.Text[offset+e.Length:] indexMovedBy += 8 } } |