def send_file(channel, file, caption: nil, tts: false, filename: nil, spoiler: nil)
      if file.respond_to?(:read)
        if spoiler
          filename ||= File.basename(file.path)
          filename = 'SPOILER_' + filename unless filename.start_with? 'SPOILER_'
        end
        # https://github.com/rest-client/rest-client/blob/v2.0.2/lib/restclient/payload.rb#L160
        file.define_singleton_method(:original_filename) { filename } if filename
      end

      channel = channel.resolve_id
      response = API::Channel.upload_file(token, channel, file, caption: caption, tts: tts)
      Message.new(JSON.parse(response), self)
    end
def send_file(channel, file, caption: nil, tts: false, filename: nil, spoiler: nil)
      if file.respond_to?(:read)
        if spoiler
          filename ||= File.basename(file.path)
          filename = 'SPOILER_' + filename unless filename.start_with? 'SPOILER_'
        end
        # https://github.com/rest-client/rest-client/blob/v2.0.2/lib/restclient/payload.rb#L160
        file.define_singleton_method(:original_filename) { filename } if filename
      end

      channel = channel.resolve_id
      response = API::Channel.upload_file(token, channel, file, caption: caption, tts: tts)
      Message.new(JSON.parse(response), self)
    end
Sends a file to a channel. If it is an image, it will automatically be embedded.
 @note This executes in a blocking way, so if you're sending long files, be wary of delays.
 @param channel [Channel, Integer, #resolve_id] The channel to send something to.
 @param file [File] The file that should be sent.
 @param caption [string] The caption for the file.
 @param tts [true, false] Whether or not this file's caption should be sent using Discord text-to-speech.
 @param filename [String] Overrides the filename of the uploaded file
 @param spoiler [true, false] Whether or not this file should appear as a spoiler.
 @example Send a file from disk
   bot.send_file(83281822225530880, File.open('rubytaco.png', 'r'))