services/slack.rb
# Slack truncates attachments at 8000 bytes
Slack truncates attachments at 8000 bytes
Slack truncates attachments at 8000 bytes
def format_content(events, limit = 7990)
    body = ''
    events.each do |event|
      message = syslog_format(event) + "\n"
      if (body.length + message.length) < limit
        body << message
      else
        break
      end
    end
    body = body.gsub('```', '` ` `')
    "```" + body + "```"
  end
def format_content ( events , limit = 7990 ) body = '' events . each do | event | message = syslog_format ( event ) + "\n" if ( body . length + message . length ) < limit body << message else break end end body = body . gsub ( '```' , '` ` `' ) "```" + body + "```" end
Slack truncates attachments at 8000 bytes
Slack truncates attachments at 8000 bytes
# Provide some basic escaping of ``` in messages
events
limit