-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvariables.php
More file actions
34 lines (24 loc) · 819 Bytes
/
Copy pathvariables.php
File metadata and controls
34 lines (24 loc) · 819 Bytes
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
<?php
include_once 'conexion.php';
$website = "https://api.telegram.org/bot".token;
$update = file_get_contents('php://input');
$update = json_decode($update, TRUE);
$chatId = $update["message"]["chat"]["id"];
$messageId = $update["message"]["message_id"];
$userId = $update["message"]['from']['id'];
$chatType = $update["message"]["chat"]["type"];
$chatTitle = $update["message"]["chat"]["title"];
$chatUsername = $update["message"]["chat"]["username"];
$firstname = $update["message"]['from']['username'];
if ($firstname=="") {
$firstname = $update["message"]['from']['first_name'];
}else{
$firstname = "@".$firstname;
}
if ($chatUsername=="") {
$chatUsername = $update["message"]['chat']['first_name'];
}else{
$chatUsername = "@".$chatUsername;
}
$message = $update["message"]["text"];
?>