From 74b3537bd0c1c39b769b87f600f0b4d9d419c038 Mon Sep 17 00:00:00 2001 From: Joshua Sadlowski Date: Wed, 10 Apr 2024 12:48:24 +0200 Subject: [PATCH 1/2] :sparkles: Add isOneShot for Alexa request --- platforms/platform-alexa/src/AlexaRequest.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platforms/platform-alexa/src/AlexaRequest.ts b/platforms/platform-alexa/src/AlexaRequest.ts index 069a40747..002839b07 100644 --- a/platforms/platform-alexa/src/AlexaRequest.ts +++ b/platforms/platform-alexa/src/AlexaRequest.ts @@ -30,6 +30,10 @@ export class AlexaRequest extends JovoRequest { session?: Session; request?: Request; + isOneShot(): boolean { + return this.getInputType() === InputType.Intent && !!this.session?.new; + } + getLocale(): string | undefined { return this.request?.locale; } From c710a779b4d829903d363fa35769a2430b8bce92 Mon Sep 17 00:00:00 2001 From: Joshua Sadlowski Date: Wed, 10 Apr 2024 12:58:36 +0200 Subject: [PATCH 2/2] :recycle: Refactor $request.session?.new to $request.isNewSession() --- platforms/platform-alexa/src/AlexaRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/platform-alexa/src/AlexaRequest.ts b/platforms/platform-alexa/src/AlexaRequest.ts index 002839b07..736be4391 100644 --- a/platforms/platform-alexa/src/AlexaRequest.ts +++ b/platforms/platform-alexa/src/AlexaRequest.ts @@ -31,7 +31,7 @@ export class AlexaRequest extends JovoRequest { request?: Request; isOneShot(): boolean { - return this.getInputType() === InputType.Intent && !!this.session?.new; + return this.getInputType() === InputType.Intent && !!this.isNewSession(); } getLocale(): string | undefined {