Making telephone call with button
# 🤝help
f
This has been asked before but i couldnt find a solution...is there a way to place a button with a call link? (like 'href=tel:')? Is there any way to make calls with the bot? Need solutions for webchat and whatsapp.
f
Hey there, You can do it from your website, by sending a custom event to it and then making the call from your website, but the
tel:
link will only work on devices that support it. It won't work on desktops or laptops, it might open a VoIP application, if the device has it installed. You can use something like this on your website:
Copy code
javascript
window.botpressWebChat.onEvent(
  function(event) {
    if (event.type === 'TRIGGER') {
      console.log('Got event');
      window.location.href = 'tel:+1234567890'; // Replace with the actual phone number
    }
  },
  ['TRIGGER']
);
Its been a while since I have used the .onEvent, but I think that should receive it and proceed.
f
Thanks for this! Will implement on the webpage.
2 Views