What is the right way to measure time between bot's message and user's answer in the bot framework?
I have a quiz bot where the person needs to answer within 10 seconds. I am using the bot framework where I measure the timestamp when the bot sends the message and I record another timestamp when the user's answer is received inside the dialog. I however feel this approach is flawed as it doesnt take network latency into account. The timestamp while sending the message if I am not mistaken is the server timestamp and the timestamp while receiving the message is also the time at which the server received the message. Total time difference = server's timestamp + send delay + user delay + receive delay - server's timestamp on receive is the formula If I am not mistaken. What is the right way for me to enforce a 10 second constraint on the user
I would recommend you to keep your approach as otherwise your quiz will be easy-hackable. Let me describe. If you somehow send timestamp from client-side, user will be able to easily edit that timestamp (even using inspector tools inside modern browsers) and then send you fake timestamp. So, he will be able to win easily. Also you can combine both approaches by sending timestamp from client side and comparing it with the timestamp of message receivement on server side. And if the difference is not big enough (assuming it's not hacked), then use client-side's timestamp, otherwise - use the server-side timestamp and punish the user :)
If you do not want to consider the total time of server's timestamp + send delay + user delay then, you could consider the time when the message is delivered to the user. So now you could calculate the timestamp between message delivered and users response. Kindly follow the below link: https://developers.facebook.com/docs/messenger-platform/webhook-reference/message-delivered
How to make telegram bot to remove links?
Testing in Bot Framework returns 401 Unauthorized
Bot Framework .Net Activity reply = activity.CreateReply(
How to access the filled data when using Formflow Namespace in Skype Bot Framework?
Microsoft bot framework getting the users time zone
How to get credentials for the Direct Line API microsoft bot framework?
Telegram bots: How much API keys can I generate?
Weird rendering in “Fetch as Google”
Effective way of training the bot, language processing APIs
What would be the right way to ask the person to enter a city inside a bot?
What is the right way to save/track state inside a Facebook Messenger bot?
How to implement a chatbot to human executive switch using Microsoft Bot Framework?
How to stop or throttle bot traffic
Skype bot card images not showing up
Bot Framework - Sign-In Card, how get auth result
How to stop my telegram bot replying to a message multiple times