-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathScavengerHandlerAlgorithm.txt
More file actions
33 lines (31 loc) · 1.84 KB
/
ScavengerHandlerAlgorithm.txt
File metadata and controls
33 lines (31 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Scenario:
===================================
The TwiMLHandler receives a message
What do we do???
-----------------------------------
We check the message to see if we can find a registered User from the sending Phone number
If we can get a user then
- We check to see which clue they're on
If we find a clue then
- We check to see if they sent a global command (e.g. Quit, Time, Help, etc...)
If we find a global command then
- We respond with the results of that command function
Else (they must have sent an answer)
- We check to see if sent a match to an Accepted Answer for that clue
If the Answer is Accepted for that clue then
- We check that Answer to see which clue to send next
If we find a clue then
- We send that clue as a response
Else (No more clues, it's over or broken)
- We send a response that the hunt is over and there are no more clues
Else (Check global commands then hints)
Else (Send em' Hints)
- We check to see if they have hints available for that clue
If there are hints available then
- We send them the hint
Else (Things are too hard or they are bad?)
- We recommend they skip and message admins to let them know the hunt is too hard
Else (They haven't started yet)
- We send them the first clue for the adventure
Else (I'm a TwiML handler and who the hell are you??)
We respond saying that they haven't registered