-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
118 lines (105 loc) · 3.35 KB
/
index.php
File metadata and controls
118 lines (105 loc) · 3.35 KB
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
<?php
$_POST = json_decode(file_get_contents('php://input'), true);
$action = $_POST['result']['action'];
$parameters = $_POST['result']['parameters'];
$_return = "";
$_anchTag = "";
$games = array(
'junglewild',
'bierhaus200',
'rocketreturns',
'spiritguidepanda',
'emeraldfalls',
'tropicalfish',
'monopolypartytrain-desktop',
'quickhitbgfgf',
'dragonsfire',
'wickedbeauty',
'kisshydra',
'cashwizard',
'epicmonopoly',
'empire',
'margaritaville',
'bigredlantern',
'ladyrobinhood',
'giantsgold',
'romeandegypt',
'superjackpotparty',
'junglewild2',
'wildshootout',
'superredphoenix',
'rainbowriches',
'zeus',
'mysticalfortunes',
'glitz',
'lancelot',
'pridenprey',
'greatwall2',
'romanchariots',
'lockitlinkdiamonds'
);
if ($action == "getCategory") {
switch ($parameters['facts-category']) {
case "Account":
$_return = "Link your core system account from here"; break;
case "Casino":
$_return = "Get the updates from Hotel, Clubs, Bar, restaurents from here"; break;
case "Play":
$_return = "Play your Slots and Table games from here"; break;
default:
$_return = "Default Response from Bot-Web-Hook";
break;
}
}
if ($action == "navigatetogame") {
if(isset($parameters['game-name'])) {
$game_name = strtolower($parameters['game-name']);
$input = preg_quote($game_name, '~'); // don't forget to quote input string!
$result = preg_filter('~' . $input . '~', null, $games);
if(sizeof($result) == 0) {
// no match
$_return = "Sorry " . $parameters['game-name'] . " is not added yet";
} elseif(sizeof($result) == 1) {
// exact match
$values = array_keys( $result);
$_return = $games[$values[0]];
//$_anchTag = "<a href=\'https://localhost:8000/game/". $games[$values[0]] ."\' class='function\' rel=\'rdfs-seeAlso\'>".$games[$values[0]]."</a>";
$_anchTag = "https://localhost:8000/game/". $games[$values[0]];
} else {
// more than one match
$values = array_values( $result);
$_return = implode($values, ",");
}
}
/* Pay load json
"game-name" : "romanchariots",
"popular_game" : "open new games"
"new_game" : "newly added game"
*/
if(isset($parameters['new_game'])) {
$_return = "zeus";
}
if (isset($parameters['popular_game'])) {
$_return = "quickhitplatinum";
}
/*foreach ($games as $parameters['game-name']) {
if (strpos($value, 'green') !== false) { $results[] = $value; }
}*/
}
/*if( empty($results) ) { $_return = 'No matches found.'; }
else { $_return = "'green' was found in: "; }*/
// Send JSON Output to the BOT
function sendToBot() {
/********************************** START ************************************ */
print_r(
'{
"speech": "' . $_return . '",
"displayText": "' . $_anchTag . '",
"data": {},
"contextOut": [],
"source": "webhook"
}'
);
/********************************** END ************************************ */
}
?>