-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
53 lines (36 loc) · 1.26 KB
/
main.py
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
49
50
51
52
53
from flask import Flask, request as flask_request
from flask_ask import Ask, context, request as ask_request
import Alexa
app = Flask(__name__)
ask = Ask(app, '/')
@ask.launch
def launch():
city = flask_request.args.get('city')
return Alexa.launch_intent(city)
@ask.intent('AMAZON.HelpIntent')
def help_intent():
city = flask_request.args.get('city')
return Alexa.help_intent(city)
@ask.intent('AMAZON.StopIntent')
def stop_intent():
return Alexa.stop_intent()
@ask.intent('AMAZON.CancelIntent')
def cancel_intent():
return Alexa.stop_intent()
@ask.intent('CheckIntent')
def check_intent(route, stop, agency):
city = flask_request.args.get('city')
return Alexa.check_intent(ask_request, city, route, stop, agency)
@ask.intent('SetIntent')
def set_intent(route, stop, preset, agency):
city = flask_request.args.get('city')
user = context.System.user.userId
return Alexa.set_intent(ask_request, city, user, route, stop, preset, agency)
@ask.intent('GetIntent')
def get_intent(preset, agency):
city = flask_request.args.get('city')
user = context.System.user.userId
return Alexa.get_intent(ask_request, city, user, preset, agency)
if __name__ == '__main__':
app.config['ASK_VERIFY_REQUESTS'] = False
app.run()