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

class TestIntent : BaseIntent{
	override AlexaResult onIntent(AlexaEvent, AlexaContext){
		AlexaResult res;
		res._version = "v3";
		return res;
	}
}

class TestSkill : AlexaSkill!TestSkill{
	this(){
		super([]);
		addIntent(new TestIntent);
	}
}

auto skill = new TestSkill();
AlexaEvent ev;
ev.request.type = AlexaRequest.Type.IntentRequest;
ev.request.intent.name = "TestIntent";
auto res = skill.executeEvent(ev,AlexaContext());
assert(res._version == "v3");

Meta