app.rb
# Puts together the json payload that needs to be sent back to Slack
Puts together the json payload that needs to be sent back to Slack
Puts together the json payload that needs to be sent back to Slack
def post_response(reply)
  response = { text: reply, link_names: 1 }
  response[:username] = ENV["BOT_USERNAME"] unless ENV["BOT_USERNAME"].nil?
  response[:icon_emoji] = ENV["BOT_ICON"] unless ENV["BOT_ICON"].nil?
  puts "[LOG] [WEBHOOK] #{response}"
  HTTParty.post(ENV["WEBHOOK_URL"], body: response.to_json) 
end
def post_response ( reply ) response = { text : reply , link_names : 1 } response [ :username ] = ENV [ "BOT_USERNAME" ] unless ENV [ "BOT_USERNAME" ] . nil? response [ :icon_emoji ] = ENV [ "BOT_ICON" ] unless ENV [ "BOT_ICON" ] . nil? puts "[LOG] [WEBHOOK] #{response}" HTTParty . post ( ENV [ "WEBHOOK_URL" ] , body : response . to_json ) end
Puts together the json payload that needs to be sent back to Slack
Puts together the json payload that needs to be sent back to Slack
# That environment variable is required.
reply
<not_specific>