code: func (b *Bmattermost) handleUploadFile(msg *config.Message) (string, error) {
  	var err error
  	var res, id string
  	channelID := b.mc.GetChannelId(msg.Channel, b.TeamID)
  	for _, f := range msg.Extra["file"] {
  		fi := f.(config.FileInfo)
  		id, err = b.mc.UploadFile(*fi.Data, channelID, fi.Name)
  		if err != nil {
  			return "", err
  		}
  		msg.Text = fi.Comment
  		if b.GetBool("PrefixMessagesWithNick") {
  			msg.Text = msg.Username + msg.Text
  		}
  		res, err = b.mc.PostMessageWithFiles(channelID, msg.Text, msg.ParentID, []string{id})
  	}
  	return res, err
  }
docs: // handleUploadFile handles native upload of files