summaryrefslogtreecommitdiffstats
path: root/bridge/telegram/telegram.go
diff options
context:
space:
mode:
authorDavid Hill <dhill@mindcry.org>2018-11-07 14:36:50 -0500
committerWim <wim@42.be>2018-11-07 20:36:50 +0100
commit0e2522279e8671a345c1be6b8b07c0f1a505e23e (patch)
tree968ac4b1acd0352ae9962d6f71bfd7d9c668596f /bridge/telegram/telegram.go
parent141a42a75b47b0a05f5b360ff5711819d3727a75 (diff)
downloadmatterbridge-msglm-0e2522279e8671a345c1be6b8b07c0f1a505e23e.tar.gz
matterbridge-msglm-0e2522279e8671a345c1be6b8b07c0f1a505e23e.tar.bz2
matterbridge-msglm-0e2522279e8671a345c1be6b8b07c0f1a505e23e.zip
Clean up various stuff (#508)
* various cleanups
Diffstat (limited to 'bridge/telegram/telegram.go')
-rw-r--r--bridge/telegram/telegram.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go
index 378f383d..93cc82f6 100644
--- a/bridge/telegram/telegram.go
+++ b/bridge/telegram/telegram.go
@@ -377,7 +377,10 @@ func (b *Btelegram) handleUploadFile(msg *config.Message, chatid int64) (string,
var c tgbotapi.Chattable
for _, f := range msg.Extra["file"] {
fi := f.(config.FileInfo)
- file := tgbotapi.FileBytes{fi.Name, *fi.Data}
+ file := tgbotapi.FileBytes{
+ Name: fi.Name,
+ Bytes: *fi.Data,
+ }
re := regexp.MustCompile(".(jpg|png)$")
if re.MatchString(fi.Name) {
c = tgbotapi.NewPhotoUpload(chatid, file)