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: channel_delete.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 ChannelDelete < ::Jobs::Base
      def execute(args
    
      def execute(args = {})
        chat_channel = ::Chat::Channel.with_deleted.find_by(id: args[:chat_channel_id])

        # this should not really happen, but better to do this than throw an error
        if chat_channel.blank?
          ::Rails.logger.warn(
            "Chat channel #{args[:chat_channel_id]} could not be found, aborting delete job.",
          )
          return
        end

        ::DistributedMutex.synchronize("delete_chat_channel_#{chat_channel.id}") do
          ::Rails.logger.debug("Deleting webhooks and events for channel #{chat_channel.id}")
          ::Chat::Message.transaction do
            webhooks = ::Chat::IncomingWebhook.where(chat_channel: chat_channel)
            ::Chat::WebhookEvent.where(incoming_chat_webhook_id: webhooks.select(:id)).delete_all
            webhooks.delete_all
          end

          ::Rails.logger.debug("Deleting drafts and memberships for channel #{chat_channel.id}")
          ::Chat::Draft.where(chat_channel: chat_channel).delete_all
          ::Chat::UserChatChannelMembership.where(chat_channel: chat_channel).delete_all

          ::Rails.logger.debug(
            "Deleting chat messages, mentions, revisions, and uploads for channel #{chat_channel.id}",
          )
          chat_messages = ::Chat::Message.where(chat_channel: chat_channel)
          delete_messages_and_related_records(chat_channel, chat_messages) if chat_messages.any?
        end
      end