@@ -141,6 +141,7 @@ const GlobalHandlers = {
141
141
canHandle ( handlerInput ) {
142
142
const { request } = handlerInput . requestEnvelope ;
143
143
const intentName = request . intent ? request . intent . name : '' ;
144
+
144
145
console . log ( "Global.StopIntentHandler: checking if it can handle "
145
146
+ request . type + " for " + intentName ) ;
146
147
return request . type === 'IntentRequest'
@@ -149,7 +150,7 @@ const GlobalHandlers = {
149
150
handle ( handlerInput ) {
150
151
console . log ( "Global.StopIntentHandler: handling request" ) ;
151
152
handlerInput . responseBuilder . speak ( 'Good Bye!' )
152
- GlobalHandlers . SessionEndedRequestHandler . handle ( handlerInput ) ;
153
+ return GlobalHandlers . SessionEndedRequestHandler . handle ( handlerInput ) ;
153
154
}
154
155
} ,
155
156
GameEngineInputHandler : {
@@ -189,11 +190,11 @@ const GlobalHandlers = {
189
190
return GamePlay . HandleButtonPressed ( handlerInput ) ;
190
191
}
191
192
break ;
192
- case 'timeout' :
193
- if ( sessionAttributes . state == Settings . SKILL_STATES . ROLL_CALL_MODE ) {
194
- return RollCall . HandleTimeout ( handlerInput ) ;
195
- } else if ( sessionAttributes . state == Settings . SKILL_STATES . PLAY_MODE ) {
193
+ case 'timeout' :
194
+ if ( sessionAttributes . state == Settings . SKILL_STATES . PLAY_MODE ) {
196
195
return GamePlay . HandleTimeout ( handlerInput ) ;
196
+ } else {
197
+ RollCall . HandleTimeout ( handlerInput ) ;
197
198
}
198
199
break ;
199
200
}
@@ -309,7 +310,9 @@ const GlobalHandlers = {
309
310
console . log ( `Session ended with reason: ${ handlerInput . requestEnvelope . request . reason } ` ) ;
310
311
let response = handlerInput . responseBuilder . getResponse ( ) ;
311
312
response . shouldEndSession = true ;
312
- return response ;
313
+ const ctx = handlerInput . attributesManager . getRequestAttributes ( ) ;
314
+ ctx . outputSpeech = [ "Good bye!" ] ;
315
+ return handlerInput . responseBuilder . getResponse ( ) ;
313
316
} ,
314
317
} ,
315
318
RequestInterceptor : {
0 commit comments