Repository: pedroslopez/whatsapp-web.js
File: src/util/Injected.js (JavaScript)

Code before:
    });
};

exports.LoadUtils = () => {
    window.WWebJS = {};

    window.WWebJS.sendSeen = async (chatId) => {
        let chat = window.Store.Chat.get(chatId);
        if (chat !== undefined) {
            await window.Store.SendSeen.sendSeen(chat, false);
            return true;
        }
        return false;

    };

    window.WWebJS.prepareMessageButtons = (buttonsOptions) => {
        const returnObject = {};

        if (!buttonsOptions.buttons) {
            return returnObject;
        }
        
        if (typeof buttonsOptions.useTemplateButtons === 'undefined' || buttonsOptions.useTemplateButtons === null) {
            buttonsOptions.useTemplateButtons = buttonsOptions.buttons.some((button) => {
                return 'callButton' in button || 'url' in button;
            });
        }
        
        returnObject.title = buttonsOptions.title;
        returnObject.footer = buttonsOptions.footer;
    
        if (buttonsOptions.useTemplateButtons) {
            returnObject.isFromTemplate = true;
            returnObject.hydratedButtons = buttonsOptions.buttons;
            returnObject.buttons = new window.Store.TemplateButtonCollection;

            returnObject.buttons.add(returnObject.hydratedButtons.map((button, index) => {
                const buttonIndex = button.index ? button.index : index;
                if (button.urlButton) {
                    return new window.Store.TemplateButtonModel({
                        id: buttonIndex,
                        displayText: button.urlButton?.displayText || '',
                        url: button.urlButton?.url,
                        subtype: 'url'
                    });
                } else if (button.callButton) {
                    return new window.Store.TemplateButtonModel({
                        id: buttonIndex,
                        displayText: button.callButton?.displayText,
                        phoneNumber: button.callButton?.phoneNumber,

Review comment (suggestion):
```suggestion
                return 'callButton' in button || 'urlButton' in button;
```


Code after:
        if (type === 'button') {
            return window.mR.findModule('DROP_ATTR')[0].DROP_ATTR;
        }
        return func(...args);
    });
};

exports.LoadUtils = () => {
    window.WWebJS = {};

    window.WWebJS.sendSeen = async (chatId) => {
        let chat = window.Store.Chat.get(chatId);
        if (chat !== undefined) {
            await window.Store.SendSeen.sendSeen(chat, false);
            return true;
        }
        return false;

    };

    window.WWebJS.prepareMessageButtons = (buttonsOptions) => {
        const returnObject = {};

        if (!buttonsOptions.buttons) {
            return returnObject;
        }
        
        if (typeof buttonsOptions.useTemplateButtons === 'undefined' || buttonsOptions.useTemplateButtons === null) {
            buttonsOptions.useTemplateButtons = buttonsOptions.buttons.some((button) => {
                return 'callButton' in button || 'urlButton' in button;
            });
        }
        
        returnObject.title = buttonsOptions.title;
        returnObject.footer = buttonsOptions.footer;
    
        if (buttonsOptions.useTemplateButtons) {
            returnObject.isFromTemplate = true;
            returnObject.hydratedButtons = buttonsOptions.buttons;
            returnObject.buttons = new window.Store.TemplateButtonCollection;

            returnObject.buttons.add(returnObject.hydratedButtons.map((button, index) => {
                const buttonIndex = button.index ? button.index : index;
                if (button.urlButton) {
                    return new window.Store.TemplateButtonModel({
                        id: buttonIndex,
                        displayText: button.urlButton?.displayText || '',
                        url: button.urlButton?.url,
                        subtype: 'url'
                    });
                } else if (button.callButton) {