mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-06-26 16:39:24 +00:00
@ -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)
|
||||
|
Reference in New Issue
Block a user