Skip to content

Instantly share code, notes, and snippets.

@rmtuckerphx
Created February 12, 2022 17:05
Show Gist options
  • Save rmtuckerphx/ce9f0656fcb4badaa35816122c09df57 to your computer and use it in GitHub Desktop.
Save rmtuckerphx/ce9f0656fcb4badaa35816122c09df57 to your computer and use it in GitHub Desktop.
Jovo v4 END w/ OutputTemplate
import { AlexaPlatform } from '@jovotech/platform-alexa';
import { App } from '@jovotech/framework';
const app = new App({
components: [GlobalComponent, LoveHatePizzaComponent],
plugins: [
new AlexaPlatform({
intentMap: {
'AMAZON.StopIntent': 'END',
'AMAZON.CancelIntent': 'END',
}
}),
],
logging: true,
});
export { app };
import { Component, BaseComponent, Global, Handle } from '@jovotech/framework';
import { GoodbyeOutput } from '../output/GoodbyeOutput';
@Global()
@Component()
export class GlobalComponent extends BaseComponent {
@Handle({ prioritizedOverUnhandled: true })
END() {
return this.$send(GoodbyeOutput);
}
}
import { BaseOutput, Output, OutputTemplate } from '@jovotech/framework';
@Output()
export class GoodbyeOutput extends BaseOutput {
build(): OutputTemplate | OutputTemplate[] {
return {
message: 'Goodbye',
listen: false,
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment