Add forwardMessages method for batch forwarding
This commit is contained in:
parent
5e52ceea4b
commit
2e58fcf108
6 changed files with 162 additions and 7 deletions
46
src/TgBotLib/Objects/MessageId.php
Normal file
46
src/TgBotLib/Objects/MessageId.php
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace TgBotLib\Objects;
|
||||
|
||||
use TgBotLib\Interfaces\ObjectTypeInterface;
|
||||
|
||||
class MessageId implements ObjectTypeInterface
|
||||
{
|
||||
private int $message_id;
|
||||
|
||||
/**
|
||||
* Unique message identifier
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getMessageId(): int
|
||||
{
|
||||
return $this->message_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function toArray(): ?array
|
||||
{
|
||||
return [
|
||||
'message_id' => $this->message_id
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function fromArray(?array $data): ?MessageId
|
||||
{
|
||||
if (empty($data))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
$object->message_id = $data['message_id'];
|
||||
|
||||
return $object;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue