File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -28,22 +28,21 @@ const dict = k => {
28
28
} ;
29
29
30
30
function welcomeHandler ( app ) {
31
- app . data . used = [ 'しりとり' ] ;
32
- app . ask ( 'しりとり' ) ;
31
+ app . ask ( 'どうぞ、始めて下さい' ) ;
33
32
}
34
33
35
34
function gameHandler ( app ) {
36
35
shiritori . loaded . then ( ( ) => {
37
36
const input = app . getRawInput ( ) ;
38
37
shiritori . interact ( dict , input , app . data . used , {
39
38
lose ( ) {
40
- app . tell ( 'ざんねん。' ) ;
39
+ app . tell ( 'ざんねん。あなたの負けです。 ' ) ;
41
40
} ,
42
41
win ( word , kana ) {
43
42
if ( word ) {
44
43
app . tell ( `${ word } [${ kana } ]` ) ;
45
44
} else {
46
- app . tell ( 'すごい!' ) ;
45
+ app . tell ( 'すごい!あなたの勝ちです。 ' ) ;
47
46
}
48
47
} ,
49
48
next ( word , kana ) {
@@ -69,6 +68,7 @@ actionMap.set('default', defaultHandler);
69
68
70
69
exports . shiritori = functions . https . onRequest ( ( request , response ) => {
71
70
const app = new DialogflowApp ( { request, response} ) ;
71
+ app . data . used = app . data . used || [ ] ;
72
72
console . log ( 'Request headers: ' + JSON . stringify ( request . headers ) ) ;
73
73
console . log ( 'Request body: ' + JSON . stringify ( request . body ) ) ;
74
74
app . handleRequest ( actionMap ) ;
You can’t perform that action at this time.
0 commit comments