Add method to retrieve any available message
This commit is contained in:
parent
513344b4a6
commit
ba6e991b23
1 changed files with 18 additions and 0 deletions
|
@ -295,6 +295,24 @@
|
|||
return $this->removed_chat_boost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves any type of message that is currently available. This method checks for the presence of a standard message,
|
||||
* an edited message, a channel post, an edited channel post, a business message, or an edited business message,
|
||||
* and returns the first one found.
|
||||
*
|
||||
* @return Message|null
|
||||
*/
|
||||
public function getAnyMessage(): ?Message
|
||||
{
|
||||
return
|
||||
$this->message ??
|
||||
$this->edited_message ??
|
||||
$this->channel_post ??
|
||||
$this->edited_channel_post ??
|
||||
$this->business_message ??
|
||||
$this->edited_business_message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue