-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
35 lines (28 loc) · 887 Bytes
/
index.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
<?php
$botToken = "";
$website = "https://api.telegram.org/bot".$botToken;
$update = file_get_contents('php://input');
$update = json_decode($update, True);
$config = [
'mysql_host' => '',
'mysql_user' => '',
'mysql_password' => '',
'mysql_db' => ''
];
$mysqli = new mysqli(
$config['mysql_host'],
$config['mysql_user'],
$config['mysql_password'],
$config['mysql_db']
);
$mysqli->query("set names utf8mb4_general_ci");
$text = $update['message']['text'];
$chatId = $update['message']['chat']['id'];
$userId = $update['message']['from']['id'];
function sendMessage($chatId, $text) {
$url = $GLOBALS[website]."/sendMessage?chat_id=$chatId&parse_mode=HTML&text=".urlencode($text);
file_get_contents($url);
}
include "/var/www/html/game/assets/start.php";
include "/var/www/html/game/assets/commands.php";
?>