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: notify_mentioned.rb
    path of file: ./repos/discourse/plugins/chat/app/jobs/regular/chat
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Jobs
  module Chat
    class NotifyMentioned < ::Jobs::Base
      def execute(args = {})
        @chat_message =
          ::Chat::Message.includes(:user, :revisions, chat_channel: :chatable).find_by(
            id: args[:chat_message_id],
          )
        i
    
      def build_data_for(membership, identifier_type:)
        data = {
          chat_message_id: @chat_message.id,
          chat_channel_id: @chat_channel.id,
          mentioned_by_username: @creator.username,
          is_direct_message_channel: @chat_channel.direct_message_channel?,
        }

        data[:chat_thread_id] = @chat_message.thread_id if @chat_message.in_thread?

        if !@is_direct_message_channel
          data[:chat_channel_title] = @chat_channel.title(membership.user)
          data[:chat_channel_slug] = @chat_channel.slug
        end