bots


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

Related Links

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

Categories

HOME
opengl
protocol-buffers
xcode8.1
kendo-dropdown
long-integer
nsview
ios-simulator
odata
malware
supercollider
stored-procedures
swarm
live-streaming
mailgun
fresco
phonegap-build
mixpanel
susy-sass
renderscript
nullreferenceexception
stackexchange.redis
multi-upload
plyr
prompt
jackrabbit-oak
cube
winsock
tightvnc
opnet
microsoft-certifications
listjs
landscape
unification
klee
zend-form
xcode8.2
section508
sonarqube5.2
django-static-precompiler
image-registration
uiautomatorviewer
hibernate-ogm
renderman
android-sharing
degrees
clp
oci
fragmentstatepageradapter
yii2-model
wicked-pdf
uibinder
processor
persistent-object-store
as3-api
servicestack-bsd
python-cffi
auto-generate
netdatacontractserializer
relational-model
phpredis
string.format
flurry-analytics
inputbox
tabris
mobile-country-code
lumia-imaging-sdk
code-complexity
tabletools
property-injection
particle-swarm
mft
facebook-game-groups
postgres-xc
apportable
.net-remoting
unicoins
jsplitpane
daap
viewpagerindicator
pcspim
series-40
opends
background-repeat
uipasteboard
airprint
tso
community-server
rootkit
jvm-bytecode

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App