mirror of
https://github.com/danog/MadelineProto.git
synced 2025-01-12 05:18:21 +01:00
28 lines
693 B
PHP
28 lines
693 B
PHP
|
<?php declare(strict_types=1);
|
||
|
|
||
|
namespace danog\MadelineProto\EventHandler\Message;
|
||
|
|
||
|
use danog\MadelineProto\EventHandler\Message;
|
||
|
use danog\MadelineProto\MTProto;
|
||
|
|
||
|
/**
|
||
|
* Represents an incoming or outgoing group message.
|
||
|
*/
|
||
|
class GroupMessage extends Message
|
||
|
{
|
||
|
/** ID of the sender of the message (equal to the chatId for anonymous admins) */
|
||
|
public readonly int $senderId;
|
||
|
|
||
|
/** @internal */
|
||
|
public function __construct(
|
||
|
MTProto $API,
|
||
|
array $rawMessage
|
||
|
) {
|
||
|
parent::__construct($API, $rawMessage);
|
||
|
|
||
|
$this->senderId = isset($rawMessage['from_id'])
|
||
|
? $this->API->getId($rawMessage['from_id'])
|
||
|
: $this->chatId;
|
||
|
}
|
||
|
}
|