-
Notifications
You must be signed in to change notification settings - Fork 0
/
alan-script.txt
270 lines (212 loc) · 8.01 KB
/
alan-script.txt
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
intent('(Hello| Hi)', p => {
p.play('(Hi there ! I am Alan , your assistant who will help you to shop from this e-commerce website. How can I help you?)');
});
intent('(what|how) (do|can) you (do|help|me)?', p => {
p.play('I listen to your commands and help you login,navigate,search products and add items to cart');
});
intent('what (is|does) this (website|app) (about|do)?', p => {
p.play('This is a E-commerce website were you can shop sports , electronics , health and beauty and fashion products.To know more about this website you can check our FAQ Page. Say, Go to FAQ Page , if u want to check it out.');
});
intent('(Go to my wishlist|open Wishlist)',(p)=>{
p.play({command:'Wishlist'}, p.play('Opening'));
p.play('here is your Wishlist.');
})
intent('(Go to login|open login page|login| open login)',(p)=>{
p.play({command:'Login'}, p.play('Opening Login page'));
})
intent('(close login page|close login)',(p)=>{
p.play({command:'closeLogin'}, p.play('Sure , Closing Login Page'));
})
intent('(Go to|open|show) (my|) (account|dashboard)', (p) => {
p.play({command: 'UserProfile'}, p.play('Opening'));
p.play('here is your Account.');
})
intent('(Go to|open|show) (my|) orders', (p) => {
p.play({command: 'UserOrders'}, p.play('Opening'));
p.play('here are your Orders.');
})
intent('(Go to|open|show) settings', (p) => {
p.play({command: 'SettingUser'}, p.play('Opening'));
p.play('here is your Setting.');
})
intent('(Go to|open|show|Go back to) (home|shop) (page|)', (p) => {
p.play({command: 'Home'}, p.play('Opening'));
p.play('here is your Home page where you can shop.');
})
intent('(Go to|open|show|Go back to) (FAQ) (page)', (p) => {
p.play({command: 'FAQ'}, p.play('Opening'));
p.play('Here is our FAQ page.');
})
intent('(Go to|open) admin (panel|dashboard)',(p)=>{
p.play({command:'DashboardAdmin'}, p.play('Opening'));
p.play('here is the Admin (Panel|Dashboard).');
})
intent('(Go to|open|show) (manage|all) categories',(p)=>{
p.play({command:'Categories'}, p.play('Opening'));
p.play('here is the manage categories page where you can add, remove or update one.');
})
intent('(Go to|open|show) (manage|all) orders',(p)=>{
p.play({command:'Orders'}, p.play('Opening'));
p.play('here is the manage orders page where you can update the order status.');
})
projectAPI.listCategories = function(p, param, callback) {
if (param) {
p.play(`We have, ${param.categories} which you can shop`);
} else {
p.play(`We don't have any category.`);
}
callback();
};
intent('(what|list|show) (can|all|) (I|categories|products) (get|buy|do you have?|) (here|)', p => {
p.play({command: 'ListCategories'});
});
intent('(Go to my wishlist|open Wishlist)',(p)=>{
p.play({command:'Wishlist'}, p.play('here is your Wishlist'));
})
intent('(Go to adminPanel | adminPanel)',(p)=>{
p.play({command:'adminPanel'}, p.play('Manage your orders'));
})
intent('(go back to home page | let me buy something)',(p)=>{
p.play({command:'home'}, p.play('you are in the home page'))
})
intent('(open|show|Go to) (cart| shopping cart) (page|)',(p)=>{
p.play({command:'showCart'}, p.play('Manage your orders'));
})
intent('close cart',(p)=>{
p.play({command:'closeCart'}, p.play('Closing cart'));
})
intent('(show| open | Display | Get) (some|all|) (Electronics|) (products|)',(p)=>{
p.play({command:'Electronics'}, p.play('browse Electronics here'));
})
intent('(show| open | Display | Get) (some|all|) (Fashion|) (products|)',(p)=>{
p.play({command:'Fashion'}, p.play('browse Fashion products here'));
})
intent('(show| open | Display | Get) (some|all|) (Sports|) (products|)',(p)=>{
p.play({command:'Sports'}, p.play('browse Sports products here'));
})
intent('(show| open | Display | Get) (some|all|) (Health and Beauty|) (products|)',(p)=>{
p.play({command:'HealthnBeauty'}, p.play('browse Health and Beauty products here'));
})
//show product
intent("(Open | Show | Search | Get | Show me | Get me ) $(Product* .+)", (p) => {
p.play({command: "showProduct", title: p.Product.value});
p.then(confirmReadOut);
})
intent("username is $(Word* .+)", (p) => {
p.play({command: "TypeUsername", title: p.Word.value});
})
intent("password is $(Word* .+)", (p) => {
p.play({command: "TypePassword", title: p.Word.value});
})
intent("(I don't want to buy | Remove) $(Word* .+) ( |from cart)", (p) => {
if (p.Word.value === "all") {
p.play({command: "removeAll"});
} else {
p.play({command: "removeCart", title: p.Word.value});
}
})
intent("Empty cart", (p) => {
p.play({command: "removeAll"});
p.play('removing');
})
intent("(logout | log out | sign out)",(p)=>{
p.play({command:'logout'}, p.play('Okay, logging you out. See you soon again!'));
})
intent('open cart',(p)=>{
p.play({command:'showCart'}, p.play('Manage your orders'));
})
intent('(Add to cart| add this product to cart| add this in cart| add in cart|add product to cart)',(p)=>{
p.play({command:'addToCart'});
})
intent('scroll up',(p)=>{
p.play({command:'scrollUp'});
})
intent('scroll down',(p)=>{
p.play({command:'scrollDown'});
})
intent('(Increase product quantity | Increase quantity)',(p)=>{
p.play({command:'increase'});
})
<<<<<<< HEAD
intent('Increase product quantity by $(Word* .+)',(p)=>{
p.play({command: "increaseBy", title: p.Word.value});
})
=======
>>>>>>> 98053ff22df67fa21c1696cac23faef9867a7bd5
intent('(Decrease product quantity | Decrease quantity)',(p)=>{
p.play({command:'decrease'});
})
<<<<<<< HEAD
intent('Decrease product quantity by $(Word* .+)',(p)=>{
p.play({command: "decreaseBy", title: p.Word.value});
})
intent('(Tell|About|Describe|Give|What)(is|me|)(about|description)(the|this|it|of)(product|)', (p)=> {
p.play({command: 'describeProduct'})
});
intent('(price|what|How|) (is|much) (the|for) (price|cost|it|this) (of|product)', (p)=> {
=======
intent('(Tell|About|Describe|Give)(me|)(about|description)(this|it|of)(product|)', (p)=> {
p.play({command: 'describeProduct'})
});
intent('(what|How|price|) (is|much) (the|for) (price|cost|it|this) (of|product)', (p)=> {
>>>>>>> 98053ff22df67fa21c1696cac23faef9867a7bd5
p.play({command: 'readPrice'})
});
intent('(Add|) (this|to) (product|item|) (to|) (wishlist|in wishlist|to wishlist)', (p)=> {
p.play({command: 'addToWishList'})
});
intent('(checkout | check out)', (p)=> {
p.play({command: 'checkout'})
});
intent("delivery address is $(Word* .+)", (p) => {
p.play({command: "address", title: p.Word.value});
})
intent("phone number is $(Word* .+)", (p) => {
p.play({command: "phone", title: p.Word.value});
})
<<<<<<< HEAD
intent("(pay by card | pay using card)", (p)=>{
=======
intent("pay by card", (p)=>{
>>>>>>> 98053ff22df67fa21c1696cac23faef9867a7bd5
p.play({command: "payByCard"})
})
intent("credit card number is $(Word* .+)", (p) => {
p.play({command: "ccNumber", title: p.Word.value});
})
intent("expiration date is $(Word* .+)", (p) => {
p.play({command: "expiryDate", title: p.Word.value});
})
intent("pay now", (p)=>{
p.play({command: "payNow"})
})
intent("switch login", (p)=>{
p.play({command: "switchLogin"})
})
intent("signup name is $(Word* .+)", (p) => {
p.play({command: "typeName", title: p.Word.value});
})
intent("signup email is $(Word* .+)", (p) => {
p.play({command: "typeEmail", title: p.Word.value});
})
intent("signup password is $(Word* .+)", (p) => {
p.play({command: "typeSignupPassword", title: p.Word.value});
})
intent("show order status ", (p)=>{
p.play({command: "showOrderStaus"})
})
<<<<<<< HEAD
// intent("ask for price confirmation", (p)=>{
// p.play("Do you want me to read out price and description for this product?");
//
// })
let confirmReadOut = context(()=>{
intent("yes", (p)=>{
p.play({command: "readPriceDescription"})
})
intent("no", (p)=>{
p.play("okay, let me know if I can do something else for you.")
})
})
=======
>>>>>>> 98053ff22df67fa21c1696cac23faef9867a7bd5