This commit is contained in:
24c02 2026-01-30 16:16:25 -05:00
parent 8a09f65c4c
commit 44d3475646

View file

@ -185,7 +185,7 @@ class ProcessSlackFileUploadJob < ApplicationJob
def render_slack_template(template, locals = {}) def render_slack_template(template, locals = {})
json = ApplicationController.render( json = ApplicationController.render(
template: "slack/#{template}", template: "slack/#{template}",
formats: [:slack_message], formats: [ :slack_message ],
locals: locals:
) )
JSON.parse(json, symbolize_names: true) JSON.parse(json, symbolize_names: true)
@ -193,21 +193,21 @@ class ProcessSlackFileUploadJob < ApplicationJob
def pick_flavor_message def pick_flavor_message
# Collect all possible flavor messages based on file extensions # Collect all possible flavor messages based on file extensions
flavor_messages = ["thanks, i'm gonna sell these to adfly!"] # generic fallback flavor_messages = [ "thanks, i'm gonna sell these to adfly!" ] # generic fallback
@files.each do |file| @files.each do |file|
ext = File.extname(file["name"]).delete_prefix(".").downcase ext = File.extname(file["name"]).delete_prefix(".").downcase
case ext case ext
when "gif" when "gif"
flavor_messages += ["_gif_ that file to me and i'll upload it", "_gif_ me all all your files!"] flavor_messages += [ "_gif_ that file to me and i'll upload it", "_gif_ me all all your files!" ]
when "heic" when "heic"
flavor_messages << "What the heic???" flavor_messages << "What the heic???"
when "mov" when "mov"
flavor_messages << "I'll _mov_ that to a permanent link for you" flavor_messages << "I'll _mov_ that to a permanent link for you"
when "html" when "html"
flavor_messages += ["Oh, launching a new website?", "uwu, what's this site?", "WooOOAAah hey! Are you serving a site?", "h-t-m-ello :wave:"] flavor_messages += [ "Oh, launching a new website?", "uwu, what's this site?", "WooOOAAah hey! Are you serving a site?", "h-t-m-ello :wave:" ]
when "rar" when "rar"
flavor_messages += [".rawr xD", "i also go \"rar\" sometimes!"] flavor_messages += [ ".rawr xD", "i also go \"rar\" sometimes!" ]
end end
end end