File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,7 @@ exports.parse = function(str, msg) {
37
37
}
38
38
}
39
39
40
- // TODO: Don't count if "C" or "D" is entered on a True/False question.
41
- if ( game [ id ] . inProgress && ( str == "A" || str == "B" || str == "C" || str == "D" ) )
40
+ if ( game [ id ] . inProgress && ( str == "A" || str == "B" || game [ id ] . isTrueFalse != 1 && ( str == "C" || str == "D" ) ) )
42
41
game [ id ] . participants . push ( msg . author . id ) ;
43
42
}
44
43
} ;
@@ -53,7 +52,6 @@ function doTriviaQuestion(msg) {
53
52
https . get ( "https://opentdb.com/api.php?amount=1" , ( res ) => {
54
53
res . on ( 'data' , function ( data ) {
55
54
var json = JSON . parse ( data . toString ( ) ) ;
56
- // TODO: Catch errors from server
57
55
58
56
var answers = [ ] ;
59
57
@@ -66,6 +64,9 @@ function doTriviaQuestion(msg) {
66
64
67
65
answers = answers . concat ( json . results [ 0 ] . incorrect_answers ) ;
68
66
67
+ if ( json . results [ 0 ] . incorrect_answers . length == 1 )
68
+ game [ id ] . isTrueFalse = 1 ;
69
+
69
70
var color = 3447003 ;
70
71
switch ( json . results [ 0 ] . difficulty ) {
71
72
case "easy" :
You can’t perform that action at this time.
0 commit comments