You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: finish_message_generation.rb
    path of file: ./repos/ArchiveBot/bot
    
    the code of the file until where you have to start completion: module FinishMessageGeneration
  def generate_messages(infos)
    # Group the completion data by channel.
    by_channel = infos.group_by { |info| info['started_in'] }

    # For each channel, group by user.
    by_channel.each_with_object({}) do |(channel, infos), h|
      by_user = infos.group_by { |info| info['started_by'] }

      list = []
      h[channel] = list

      by_user.each do |user, infos|
        infos.each do |info|
          if info['aborted']
            list << "#{user}: Your job for #{info['url']
    
  def generate_messages(infos)
    # Group the completion data by channel.
    by_channel = infos.group_by { |info| info['started_in'] }

    # For each channel, group by user.
    by_channel.each_with_object({}) do |(channel, infos), h|
      by_user = infos.group_by { |info| info['started_by'] }

      list = []
      h[channel] = list

      by_user.each do |user, infos|
        infos.each do |info|
          if info['aborted']
            list << "#{user}: Your job for #{info['url']} was aborted."
          else
            list << "#{user}: Your job for #{info['url']} has finished."
          end
        end
      end
    end