code: func HandleDownloadSize(logger *logrus.Entry, msg *config.Message, name string, size int64, general *config.Protocol) error {
  	// check blacklist here
  	for _, entry := range general.MediaDownloadBlackList {
  		if entry != "" {
  			re, err := regexp.Compile(entry)
  			if err != nil {
  				logger.Errorf("incorrect regexp %s for %s", entry, msg.Account)
  				continue
  			}
  			if re.MatchString(name) {
  				return fmt.Errorf("Matching blacklist %s. Not downloading %s", entry, name)
  			}
  		}
  	}
  	logger.Debugf("Trying to download %#v with size %#v", name, size)
  	if int(size) > general.MediaDownloadSize {
  		msg.Event = config.EventFileFailureSize
  		msg.Extra[msg.Event] = append(msg.Extra[msg.Event], config.FileInfo{
  			Name:    name,
  			Comment: msg.Text,
  			Size:    size,
  		})
  		return fmt.Errorf("File %#v to large to download (%#v). MediaDownloadSize is %#v", name, size, general.MediaDownloadSize)
  	}
  	return nil
  }
docs: // HandleDownloadSize checks a specified filename against the configured download blacklist
  // and checks a specified file-size against the configure limit.