-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMessage.php
39 lines (35 loc) · 1.04 KB
/
Message.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
<?php
namespace rezanadimi\telegram;
class Message
{
public $updateID;
public $messageID;
public $userID;
public $firstName;
public $userName;
public $chatID;
public $chatType;
public $dateChat;
public $chatText;
private $input;
public function __construct()
{
$this->getInput();
$post = $this->input;
$this->updateID = $post["update_id"];
$this->messageID = $post["message"]['message_id'];
$this->userID = $post["message"]['from']['id'];
$this->firstName = $post["message"]['from']['first_name'];
$this->userName = @$post["message"]['from']['username'];
$this->chatID = $post["message"]['chat']['id'];
$this->chatType = $post["message"]['chat']['type'];
$this->dateChat = $post["message"]['date'];
$this->chatText = $post["message"]['text'];
}
private function getInput()
{
$input = file_get_contents("php://input");
$this->input = json_decode($input, true);
return $this->input;
}
}