-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathe_alexa.php
More file actions
48 lines (39 loc) · 894 Bytes
/
e_alexa.php
File metadata and controls
48 lines (39 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* @file
* Hooks provided by Alexa plugin.
*
* This is an example addon file implementing a request subscriber for
* Amazon Echo Alexa Skill.
*
* If you ask Alexa, "ask <my app> help" Amazon will call AMAZON.HelpIntent.
*/
use Alexa\Response\Response;
/**
* Class PLUGIN_alexa.
*/
class PLUGIN_alexa
{
/**
* Allow the plugin to respond to whatever ASK intents it recognizes.
*
* @param \Alexa\Request\Request $request
* The Alexa request.
*
* @return \Alexa\Response\Response|null
* An Alexa response to pass along, or NULL if we don't have a response
* for this request.
*/
function config(\Alexa\Request\Request $request)
{
$response = new Response();
if (isset($request->intentName)) {
switch ($request->intentName) {
case 'AMAZON.HelpIntent':
$response->respond('Hello!');
break;
}
}
return $response;
}
}