Bot Framework Skype channel regular expressions not working - node.js

I built a bot using Bot Framework (node.js) with four connected channels (Messenger, Telegram, Skype and Web). At any moment the bot validates an inputted email address using a regular expression like this below:
/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*#([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i
It is working properly on all channels, except the Skype. E.g: gcfabri#gmail.com match with this regex but on Skype channel it doesn't happens.

According to GitHub user nwhitmont (Stack Overflow #nilsw) on issue [Skype] Regular expression not working to find email address in chat message? #4024:
Skype wraps email addresses in HTML tags, so you would need to adjust your RegEx accordingly.
On Skype channel you need to check for:
name#email.com

I was also facing the same issue and resolved by using the following regular expression.
#"\b(?!mailto:)([\w-]+(.[\w-]+)#([a-z0-9-]+(.[a-z0-9-]+)?.[a-z]{2,6}|(\d{1,3}.){3}\d{1,3})(:\d{4})?)"
Skype is converting the user input email address to a HTML text e.g (<a href='mailto:someone#example.com'>someemail#mail.com</a>). We need to find out the email from this.
For more detail, please refer.
Regex for detecting emails in text

Related

Dialogflow query working in console but not when you use embedded url

I have made a query flow in dialogflow and it has four intent and in the last intent it uses a webhook to get data from server side and displays the result. It is trained automatically and works perfectly in dialogflow console returning response and query answer. The issue is it does not work when I use embedded url. It fails to recognize the name intent and asks (Can you repeat again or fallback intent). I've removed all intents and made query again, there is no similar name intents. Yet it works well in console and not in embedded url.
For the webhook part I've used node.js service.
Please help in this issue.
By 'embedded url' if you mean Dialogflow Web Demo (DWD), you should keep in mind that DWD can be used only for simple text messages. It does not support messages from webhook or even rich responses. However, if you steel need a web widget to embed your bot to your webpage you either create your own or you should use third party solutions (like Kommunicate). Here's the link regarding the limitations of DWD.

Custom Links with Messenger Bot via Microsoft Botframework

Clicking https://www.messenger.com/t/xxxxxxxx will take you to a bot and continue the conversation, if there was no conversation it'll begin it's 'firstRun' sequence.
Is it possible to create links that will execute a specific dialog and pass in data? It should ignore previous dialog state/stack and start a new stack with the specified data as argument to that dialog.
This is not possible. The url is used to identify the user/bot in messenger. The bot doesn't see the url so it can't read from it.
I would suggest taking a different approach. You could let the user pass in the code instead of adding it to the url.
There is a new functionality in Messenger platform that allows you to send specific messages to a bot: https://developers.facebook.com/docs/messenger-platform/referral-params
I haven't tested it yet, but it may help you.

Can I install multiple bots on a single Facebook fanpage

We are having two teams building two bots for our Facebook fanpage. One is for customer service and the other one is for a quiz campaign. Can we have the two bots on the same fanpage? Will there be any conflicts such as the custom menu?
The short answer is YES!
However unless managed correctly there will be conflict.
I know it is possible to use one chatbot built on ManyChat and another on Flowxo.
I need to ensure that I LIMIT the "keywords" in ManyChat so that ManyChat does not respond and allows FLOWXO to respond.
In my situation, I am using the Pro version of MC to get users subscribed and to further broadcast to them or subscribe them to a sequence. I pass over the conversation to Flowxo for integrations to third party software and for the basic conversational aspect of the chatbot.
Passing the conversation over from one chatbot to the other takes some manipulation of the use of keywords and Flowxo's "unrecognised phrase" flow.
I will post the link to a blog post when I get around to writing about how I did it.
Another issue as you pointed out is the Greeting and Welcome text. I have not figured out a way to control this and as it turns out with my chatbot, users always appear to enter into the chatbot via ManyChat which fortunately for me is exactly what I need.

How to speak skype user with the bot using skype calling feature?

I am working on bot technology, in my current bot project I used the skype calling feature in that I want the functionality like once bot accepted the call after that whatever I spoken with bot I want that speech in my code in the form of text.
Before posted question here I did research on google and find the below link but this link contains dial pad options but I want the functionality like instead of dial pad, I am able to speak with bot and get the that speech into my code in the form of text.
https://docs.botframework.com/en-us/csharp/builder/sdkreference/calling.html
Can you please tell me how to do that?
-Pradeep

How can I add a Whatsapp function to my website?

I have very little reputation points so I cannod add a comment in this similar question.
But I need an explanation as the code is working in a different way as expected.
I would like to have a link on my website where the user can click on the whatsapp link and start the conversation with the contact.
The code I add is this:
href="intent://send/0123456789#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end
where 0123456789 were substituted with a real number subscribed to whatsapp.
But it seems working only with my contact. If I have a new number it will not work and will tell me that the contact number is not connected to whatsapp (even if it is).
How can I solve this problem?
Once this first problem is solved, I'd like to add some preformatted text to the message like: message sent from website xyz. What code should I add?
This like of code is working for Android, I need it also for iPhone, what should I use?
This other code is working on Android and on iPhone, but it doesn't allow me to add a custom contact number:
whatsapp
abid can be only an ID from a contact already saved in you phone, otherwise it will open the contact selection page in whatsapp
Please, don't share links without explanation of the content as I'm not a developer, I'm just trying to do my best following instructions of people with more knowledge.
Thank you.
As long as your explanation describes you are looking for a user to be able to Click in order to open a Chat with a specific Whatsapp active user.
Nowadays Whatsapp has emitted an API to specifically solve this needs, it's called 'Click to Chat' API and must work on all devices:
https://faq.whatsapp.com/en/general/26000030
Also, the scheme for the link you were using seems to be working correctly nowadays when used like this:
whatsapp://send?text=MESSAGE&phone=+NUMBER&abid=+NUMBER

Resources