Server Script function through client script

I have a custom button Whatsapp- Send Invoice which send invoice pdf to customer.
I want to merger server and client script. can this function be achieved through client script only?

Client script

frappe.ui.form.on('Sales Invoice', {
    refresh(frm) {
        frm.add_custom_button(__('Send Invoice'), function() {
            // Use to get the current document's name
                method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.send_whatsapp_invoice",//'your_app_path.your_module_name.your_method', // Specify the correct path to your server-side method
                args: {
                    notification_name: 'WN-0001' // Assuming 'WN-0001' is the name of your WhatsApp Notification DocType instance
                callback: function(r) {
                    if (!r.exc) {
                        // Handle successful message sending here, e.g., show a message to the user
                        frappe.msgprint(__('WhatsApp message sent successfully.'));
        }, __("Send WhatsApp Alert"));

Server Script

import frappe
from frappe.core.doctype.whatsapp_notification.whatsapp_notification import WhatsAppNotification

def send_whatsapp_invoice(docname, notification_name):
        whatsapp_notification = frappe.get_doc('WhatsApp Notification', notification_name)
        doc = frappe.get_doc('Sales Invoice', docname)
        return {'status': 'success'}
    except Exception as e:
        frappe.log_error(frappe.get_traceback(), 'send_whatsapp_invoice Error')
        return {'status': 'error', 'error': str(e)}