BaseIntent

abstract base class for a separate intent

Constructors

this
this()

c'tor

Members

Functions

getText
string getText(int _key)

forwards to currently active ITextManager.getText

onIntent
AlexaResult onIntent(AlexaEvent, AlexaContext)

handler that needs to be implemented in inheriting Intent

Properties

name
string name [@property getter]

allows to query for the intents string representation that needs to match intent schema

textManager
ITextManager textManager [@property setter]

allows to define used textManager

Inherited Members

From ITextManager

getText
string getText(int _key)

returns the localized text string depending on the loaded locale database

Examples

1 class TestIntent : BaseIntent{
2 	override AlexaResult onIntent(AlexaEvent, AlexaContext){
3 		AlexaResult res;
4 		res._version = "v3";
5 		return res;
6 	}
7 }
8 
9 class TestSkill : AlexaSkill!TestSkill{
10 	this(){
11 		super([]);
12 		addIntent(new TestIntent);
13 	}
14 }
15 
16 auto skill = new TestSkill();
17 AlexaEvent ev;
18 ev.request.type = AlexaRequest.Type.IntentRequest;
19 ev.request.intent.name = "TestIntent";
20 auto res = skill.executeEvent(ev,AlexaContext());
21 assert(res._version == "v3");

Meta