bots


How do I count the number of users in my quiz bot?


I am using bot framework where I proactively start a quiz game every 24 hours. The code for this looks like
bot.beginDialog(user.address, '/runChallenge', args, (error) => {
if (error) {
// error ocurred while starting new conversation. Channel not supported?
console.log(JSON.stringify(error), user.address)
bot.send(new builder.Message()
.text("The rat nibbled the wires before we could start the game for you. Sorry about that :(")
.address(user.address));
}
})
A couple of questions
How do i count the number of players in the game?
I could make a global variable called players inside my bot.js file
and increment it by 1 each time the bot.dialog('/quiz') is called
inside its 1st waterfall step. Given the file is included once at
the beginning, once I increment it, I guess i ll have to reset it
back to 0 somewhere.
Or I could use a local variable inside the cron job function which
can pass another parameter called playersCount as args to the dialog
where it will be a local variable but I am not sure if this is the
right approach
Everytime, a person answers incorrectly, they are out of the
challenge. I would like to count how many people answered
incorrectly. What would be a good way to go about this?
I would also like to declare the results of the quiz after say
everyone is done with it, The maximum time taken by anyone and
everyone is 15 mins for the round. I am planning to use a setTimeout
after 15 mins of initiating the game since I already use a CronJob
every 23 hours to trigger the quiz. Any suggestions?

Related Links

ValidationResult throws : “Object reference not set to an instance of an object”. when passing back choices
How to disconnect LUIS of Microsoft Bot Connector selectively?
Skype bot in “In Review” Status
Bot framework documentation qna maker [closed]
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?

Categories

HOME
office365
xcode
typelite
facebook-messenger
angular-ui-grid
yahoo-weather-api
loopbackjs
hdfs
semantic-web
mathematical-optimization
mosquitto
openfoam
joomla3.2
reportviewer
xades4j
sap-fiori
business-intelligence
jodatime
complexity-theory
max-msp-jitter
global-variables
pickle
susy-sass
varnish-vcl
boomi
codefluent
psql
angular2-highcharts
hdl
el
mime-types
quantitative-finance
channel
quartz.net
mod-wsgi
fusetools
hdmi
background-color
oracleforms
math.js
sparkle
mdns
snap-framework
delayed-job
bootstrap-sass
polyml
grails-2.5
landscape
eclipse-gmf
mv
gitolite
microkernel
swfupload
newtons-method
vb.net-to-c#
oracle-bmcs
reverse-dns
audio-converter
adblock
directwrite
image-registration
android-5.0-lollipop
uiautomatorviewer
visual-format-language
android-sharing
gtk#
htmlspecialchars
pecl
google-shopping-api
perl-data-structures
ogg
xcode6.4
tablespace
xmlbeans
logical
visual-studio-monaco
gcloud-node
qtcpsocket
node-glob
maximize
exists
sharepoint-apps
gulp-uglify
deeplink
place
highest
dnx50
unhandled
relational-model
actionpack
text-align
camus
encryption-symmetric
storing-data
accessory
jack
colon
void-pointers
office-app
smartfox
jquery-dialog
zend-pdf
zotonic
gamesalad
navigationcontroller
fbml
photo-management
simile
asp.net-mvc-views
django-pagination
mongrel
multiple-users
outlook-2007-addin
cleartype
resharper-5.0
google-translator-toolkit
source-code-protection
jquery-effects
error-detection

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