DisWarden/lib/message_processor.rb
2024-02-11 10:45:39 -07:00

19 lines
617 B
Ruby

# frozen_string_literal: true
# this class is what actually processes the message, and extracts the file/link/image from it
class MessageProcessor
def self.process_message(event)
# Check if the message has attachments
return if event.message.attachments.empty?
# Process each attachment
event.message.attachments.each do |attachment|
# TODO: logic to download the file and scan it (WIP)
puts "Found attachment: #{attachment.filename}"
# For now, just print the URL
puts "Attachment URL: #{attachment.url}"
end
# TODO: Add logic for links and images (WIP)
end
end