Un bot sur le chat Synology
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
1.5 KiB

<?php
namespace Shikiryu\Bot;
class Request
{
protected $token;
protected $user_id;
protected $username;
protected $post_id;
protected $timestamp;
protected $text;
/**
* Request constructor.
* @param array $data
*/
public function __construct(array $data)
{
if (isset($data['token'])) {
$this->token = $data['token'];
}
if (isset($data['user_id'])) {
$this->user_id = $data['user_id'];
}
if (isset($data['username'])) {
$this->username = $data['username'];
}
if (isset($data['post_id'])) {
$this->post_id = $data['post_id'];
}
if (isset($data['timestamp'])) {
$this->timestamp = $data['timestamp'];
}
if (isset($data['text'])) {
$this->text = $data['text'];
}
}
/**
* @return mixed
*/
public function getToken()
{
return $this->token;
}
/**
* @return mixed
*/
public function getUserId()
{
return $this->user_id;
}
/**
* @return mixed
*/
public function getUsername()
{
return $this->username;
}
/**
* @return mixed
*/
public function getPostId()
{
return $this->post_id;
}
/**
* @return mixed
*/
public function getTimestamp()
{
return $this->timestamp;
}
/**
* @return mixed
*/
public function getText()
{
return $this->text;
}
}