-
Notifications
You must be signed in to change notification settings - Fork 1
/
botman.php
350 lines (311 loc) · 27.4 KB
/
botman.php
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<?php
require_once 'vendor/autoload.php';
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use BotMan\BotMan\BotManFactory;
use BotMan\BotMan\Cache\SymfonyCache;
use BotMan\BotMan\Drivers\DriverManager;
use BotMan\BotMan\Messages\Attachments\Image;
require_once('bot_conversations.php');
$config = [
'botman' => [
'conversation_cache_time' => 30
],
];
DriverManager::loadDriver(\BotMan\Drivers\Web\WebDriver::class);
$adapter = new FilesystemAdapter();
$botman = BotManFactory::create($config, new SymfonyCache($adapter));
$botman->hears('.*hello.*', function ($bot) {
$bot->startConversation(new OnboardingConversation);
});
$botman->hears('.*hi.*', function ($bot) {
$bot->startConversation(new OnboardingConversation);
});
$botman->hears('.*yo.*', function ($bot) {
$bot->startConversation(new OnboardingConversation);
});
$botman->hears('!q', function($bot) {
$bot->startConversation(new Query);
});
$botman->hears('query', function($bot) {
$bot->startConversation(new Query);
});
$botman->hears('!feature', function($bot) {
$bot->startConversation(new FeatureRequest);
});
$botman->hears('Tell me about BSW', function ($bot) {
$bot->reply('BSW “Board for Student Welfare” consists of student representatives from each hostel and a few faculty members. This board has been constituted to help the students in the hour of need. BSW gives financial help, informative sessions, counselling and looks after other modes of student welfare.');
});
$botman->hears('What is BSW\?', function ($bot) {
$bot->reply('BSW “Board for Student Welfare” consists of student representatives from each hostel and a few faculty members. This board has been constituted to help the students in the hour of need. BSW gives financial help, informative sessions, counselling and looks after other modes of student welfare.');
});
$botman->hears('What does BSW do\?', function ($bot) {
$bot->reply('BSW “Board for Student Welfare” consists of student representatives from each hostel and a few faculty members. This board has been constituted to help the students in the hour of need. BSW gives financial help, informative sessions, counselling and looks after other modes of student welfare.');
});
$botman->hears('What\'s up\?', function ($bot) {
$bot->reply('The URL Bar! Oh wait, that one’s just for us chatbots.');
});
$botman->hears('Whats up\?', function ($bot) {
$bot->reply('The URL Bar! Oh wait, that one’s just for us chatbots.');
});
$botman->hears('Whats up', function ($bot) {
$bot->reply('The URL Bar! Oh wait, that one’s just for us chatbots.');
});
$botman->hears('!em', function ($bot) {
$bot->reply('
<li class="list-group-item col-12 col-md-6"> <a style="color:white;" href="tel:+91-11-2659-1000"> IIT SECURITY </a>: 11-2659-1000</li>
<li class="list-group-item col-12 col-md-6"> <a style="color:white;" href="tel:+91-11-2659-6101"> IIT FIRE SERVICE </a>: 11-2659-6101</li>
<li class="list-group-item col-12 col-md-6"> <a style="color:white;" href="tel:+91-11-2659-1500"> IIT HOSPITAL </a>: 11-2659-1500</li>
<li class="list-group-item col-12 col-md-6"> <a style="color:white;" href="tel:+91-11-2659-6666"> IIT AMBULANCE </a>: 11-2659-6666</li>
<li class="list-group-item col-12 col-md-6"> <a style="color:white;" href="tel:+91-11-2659-1699"> FACULTY GUEST HOUSE </a>: 11-2659-1699</li>
<li class="list-group-item col-12 col-md-6"> <a style="color:white;" href="tel:+91-11-2659-1906"> MAIN GUEST HOUSE </a>: 11-2659-1906</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-1400"> POWER SUPPLY (MAIN) </a>: 11-2659-1400</li>');
});
$botman->hears('em', function ($bot) {
$bot->reply('
<li class="list-group-item col-12 col-md-6"> <a style="color:white;" href="tel:+91-11-2659-1000"> IIT SECURITY </a>: 11-2659-1000</li>
<li class="list-group-item col-12 col-md-6"> <a style="color:white;" href="tel:+91-11-2659-6101"> IIT FIRE SERVICE </a>: 11-2659-6101</li>
<li class="list-group-item col-12 col-md-6"> <a style="color:white;" href="tel:+91-11-2659-1500"> IIT HOSPITAL </a>: 11-2659-1500</li>
<li class="list-group-item col-12 col-md-6"> <a style="color:white;" href="tel:+91-11-2659-6666"> IIT AMBULANCE </a>: 11-2659-6666</li>
<li class="list-group-item col-12 col-md-6"> <a style="color:white;" href="tel:+91-11-2659-1699"> FACULTY GUEST HOUSE </a>: 11-2659-1699</li>
<li class="list-group-item col-12 col-md-6"> <a style="color:white;" href="tel:+91-11-2659-1906"> MAIN GUEST HOUSE </a>: 11-2659-1906</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-1400"> POWER SUPPLY (MAIN) </a>: 11-2659-1400</li>');
});
$botman->hears('!em security', function ($bot) {
$bot->reply('
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-1000"> Security Control Room </a>: 11-2659-1000</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6500"> Anti Raging Helpline </a>: 11-2659-6500</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-1712"> Duty Officer </a>: 11-2659-1712</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6903"> Control Room (RCA) </a>: 11-2659-6903</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-7225"> Bharti School </a>: 11-2659-7225</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-7161"> Security Cabin (MSB) I </a>: 11-2659-7161</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6942"> Security Cabin (MSB) II</a>: 11-2659-6942</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6981"> Main Gate I </a>: 11-2659-6981</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6828"> Main Gate II </a>: 11-2659-6828</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6999"> Hostel Gate </a>: 11-2659-6999</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6900"> Mahrauli Gate </a>: 11-2659-6900</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6969"> JNU Gate </a>: 11-2659-6969</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6849"> Adhchini Gate </a>: 11-2659-6849</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6387"> Vishwakarma Bhawan </a>: 11-2659-6387</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-1711"> Security Officer </a>: 11-2659-1711</li>
');
});
$botman->hears('em security', function ($bot) {
$bot->reply('
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-1000"> Security Control Room </a>: 11-2659-1000</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6500"> Anti Raging Helpline </a>: 11-2659-6500</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-1712"> Duty Officer </a>: 11-2659-1712</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6903"> Control Room (RCA) </a>: 11-2659-6903</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-7225"> Bharti School </a>: 11-2659-7225</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-7161"> Security Cabin (MSB) I </a>: 11-2659-7161</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6942"> Security Cabin (MSB) II</a>: 11-2659-6942</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6981"> Main Gate I </a>: 11-2659-6981</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6828"> Main Gate II </a>: 11-2659-6828</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6999"> Hostel Gate </a>: 11-2659-6999</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6900"> Mahrauli Gate </a>: 11-2659-6900</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6969"> JNU Gate </a>: 11-2659-6969</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6849"> Adhchini Gate </a>: 11-2659-6849</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6387"> Vishwakarma Bhawan </a>: 11-2659-6387</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-1711"> Security Officer </a>: 11-2659-1711</li>
');
});
$botman->hears('!em hostels', function ($bot) {
$bot->reply('
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6911"> Aravali </a>: 11-2659-6911</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6891"> Girnar </a>: 11-2659-6891</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6825"> Himadri </a>: 11-2659-6825</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6894"> Fire Control Room Himadri </a>: 11-2659-6894</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6826"> Kailash </a>: 11-2659-6826</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6855"> Security Gate Kailash </a>: 11-2659-6855</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6915"> Karakoram</a>: 11-2659-6915</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6917"> Kumaon </a>: 11-2659-6917</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6919"> Nilgiri </a>: 11-2659-6919</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-7066"> Satpura </a>: 11-2659-7066</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6921"> Shivalik </a>: 11-2659-6921</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6899"> Udaigiri </a>: 11-2659-6899</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6923"> Vindhyachal </a>: 11-2659-6923</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-7068"> Zanskar </a>: 11-2659-7068</li>
');
});
$botman->hears('em hostels', function ($bot) {
$bot->reply('
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6911"> Aravali </a>: 11-2659-6911</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6891"> Girnar </a>: 11-2659-6891</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6825"> Himadri </a>: 11-2659-6825</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6894"> Fire Control Room Himadri </a>: 11-2659-6894</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6826"> Kailash </a>: 11-2659-6826</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6855"> Security Gate Kailash </a>: 11-2659-6855</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6915"> Karakoram</a>: 11-2659-6915</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6917"> Kumaon </a>: 11-2659-6917</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6919"> Nilgiri </a>: 11-2659-6919</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-7066"> Satpura </a>: 11-2659-7066</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6921"> Shivalik </a>: 11-2659-6921</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6899"> Udaigiri </a>: 11-2659-6899</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6923"> Vindhyachal </a>: 11-2659-6923</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-7068"> Zanskar </a>: 11-2659-7068</li>
');
});
$botman->hears('em hostel', function ($bot) {
$bot->reply('
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6911"> Aravali </a>: 11-2659-6911</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6891"> Girnar </a>: 11-2659-6891</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6825"> Himadri </a>: 11-2659-6825</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6894"> Fire Control Room Himadri </a>: 11-2659-6894</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6826"> Kailash </a>: 11-2659-6826</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6855"> Security Gate Kailash </a>: 11-2659-6855</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6915"> Karakoram</a>: 11-2659-6915</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6917"> Kumaon </a>: 11-2659-6917</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6919"> Nilgiri </a>: 11-2659-6919</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-7066"> Satpura </a>: 11-2659-7066</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6921"> Shivalik </a>: 11-2659-6921</li>
<li class="list-group-item col-12"> <a style="color:white;" href="tel:+91-11-2659-6899"> Udaigiri </a>: 11-2659-6899</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-6923"> Vindhyachal </a>: 11-2659-6923</li>
<li class="list-group-item col-12 "> <a style="color:white;" href="tel:+91-11-2659-7068"> Zanskar </a>: 11-2659-7068</li>
');
});
$botman->hears('!qp {course}', function ($bot, $course) {
$bot->reply('<a target="_blank" style="color: cornsilk;" href="http://localhost:8888/BSW_Website_2020/coursepage.php?course='.strtoupper($course).'"> Click here for '.strtoupper($course).' Question Papers</a>');
});
$botman->hears('past qps {course}', function ($bot, $course) {
$bot->reply('<a target="_blank" style="color: cornsilk;" href="http://localhost:8888/BSW_Website_2020/coursepage.php?course='.strtoupper($course).'"> Click here for '.strtoupper($course).' Question Papers</a>');
});
$botman->hears('qps {course}', function ($bot, $course) {
$bot->reply('<a target="_blank" style="color: cornsilk;" href="http://localhost:8888/BSW_Website_2020/coursepage.php?course='.strtoupper($course).'"> Click here for '.strtoupper($course).' Question Papers</a>');
});
$botman->hears('question papers {course}', function ($bot, $course) {
$bot->reply('<a target="_blank" style="color: cornsilk;" href="http://localhost:8888/BSW_Website_2020/coursepage.php?course='.strtoupper($course).'"> Click here for '.strtoupper($course).' Question Papers</a>');
});
$botman->hears('-{course}', function ($bot, $course) {
$bot->reply('<a target="_blank" style="color: cornsilk;" href="http://localhost:8888/BSW_Website_2020/coursepage.php?course='.strtoupper($course).'"> Click here for '.strtoupper($course).' Question Papers</a>');
});
$botman->hears('!rep {hostel}', function ($bot, $hostel) {
$rep = array(
"aravali" => ' <h5 class="mt-1 mb-2"> Dipanshu Patidar</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 7424905782 </button><br> </div>
<h5 class="mt-1 mb-2"> Prakhar Sharma</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 7055051155 </button><br> </div>
',
"girnar" => ' <h5 class="mt-1 mb-2"> Gaurav Chauhan</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 6239961770 </button><br> </div>
<h5 class="mt-1 mb-2"> Prabhpreet Singh</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 9915438685 </button><br> </div>
',
"himadri" => ' <h5 class="mt-1 mb-2"> Ichha Rathod</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 9664114447 </button><br> </div>
<h5 class="mt-1 mb-2"> Ishita Chawla</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 8375883773 </button><br> </div>
',
"jwalamukhi" => ' <h5 class="mt-1 mb-2"> Franklin Gari </h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 8248563561 </button><br> </div>
<h5 class="mt-1 mb-2"> Abhimanyu Singh</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected]</button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 9588354698 </button><br> </div>
',
"kailash" => ' <h5 class="mt-1 mb-2"> Ruchika kumari</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 8271812751 </button><br> </div>
<h5 class="mt-1 mb-2"> Sakshi Bhandari</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 9586597182 </button><br> </div>
',
"karakoram" => ' <h5 class="mt-1 mb-2"> Aashish Choudary</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> ...</button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span>... </button><br> </div>
<h5 class="mt-1 mb-2"> Piyush Gupta</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 9425707560 </button><br> </div>
',
"kumaon" => ' <h5 class="mt-1 mb-2"> Hardik Tanwar</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 9530368472 </button><br> </div>
<h5 class="mt-1 mb-2"> Mihir Kedia</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 8800908227 </button><br> </div>
',
"nilgiri" => ' <h5 class="mt-1 mb-2"> Jatin Goel</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 9716338929 </button><br> </div>
<h5 class="mt-1 mb-2"> Puru Arora</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 8448555978 </button><br> </div>
',
"satpura" => ' <h5 class="mt-1 mb-2"> Arvin Goyal </h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 9517649345 </button><br> </div>
<h5 class="mt-1 mb-2"> Raghav Ajitsaria</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 7595868183 </button><br> </div>
',
"shivalik" => ' <h5 class="mt-1 mb-2"> Ayush Kanodia</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected]</button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 9451422334 </button><br> </div>
<h5 class="mt-1 mb-2"> Siddhant Choudhary</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 9935029433 </button><br> </div>
',
"udaigiri" => ' <h5 class="mt-1 mb-2"> Chirag Maheshwari</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 8233957000 </button><br> </div>
<h5 class="mt-1 mb-2"> Shikhar Anand</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 7000680741 </button><br> </div>
',
"vindhyachal" => ' <h5 class="mt-1 mb-2"> Gaurav Pande</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 7219584694 </button><br> </div>
<h5 class="mt-1 mb-2"> Yash Jain</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 9706099045 </button><br> </div>
',
"zanskar" => ' <h5 class="mt-1 mb-2"> Bhupender Dhaka </h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 6377593404 </button><br> </div>
<h5 class="mt-1 mb-2"> Sanidhya Jain</h5>
<button class="btn btn-primary" style="font-size:16px; " id="hostel_button"> <span class="fa fa-envelope"> </span> [email protected] </button><br>
<button class="btn btn-success my-1" style="font-size:16px; " id="hostel_button"> <span class="fa fa-phone"> </span> +91 6264363313 </button><br> </div>
',
);
if(isset($rep[$hostel])){
$bot->reply(''.$rep[$hostel]);
}
else{
$bot->reply('Sorry, please chack your input for errors.');
}
});
$botman->hears('!joke', function ($bot) {
$curl = new Curl\Curl();
$curl->setHeader('Accept', 'text/plain');
$curl->get('https://icanhazdadjoke.com/');
$bot->reply($curl->response);
});
$botman->hears('joke', function ($bot) {
$curl = new Curl\Curl();
$curl->setHeader('Accept', 'text/plain');
$curl->get('https://icanhazdadjoke.com/');
$bot->reply($curl->response);
});
$botman->hears('tell me a joke', function ($bot) {
$curl = new Curl\Curl();
$curl->setHeader('Accept', 'text/plain');
$curl->get('https://icanhazdadjoke.com/');
$bot->reply($curl->response);
});
$botman->fallback(function($bot) {
$bot->reply('Sorry, I am not able to understand what you said. Here is a list of things I can do for you: <br>
<br>
<em>!q</em> to submit a query <br><br>
<em>Hi</em> or <em>Hello</em> to chat with me <br><br>
<em>!joke</em> to have a laugh <br><br>
<em>!qp [course]</em> to go to course question papers eg. !qp cml100 <br><br>
<em>!em</em> for emergency contacts <br><br>
<em>!em security</em> for security contacts <br><br>
<em>!em hostels</em> for hostel contacts <br><br>
<em>!rep [hostel_name]</em> for BSW Rep details');
});
$botman->listen();