Added containsMedia
method to Message
object to check if the message contains media.
This commit is contained in:
parent
07ff3c4d2b
commit
f9741c250d
2 changed files with 13 additions and 1 deletions
|
@ -1061,6 +1061,16 @@
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if any media content is present in the message.
|
||||
*
|
||||
* @return bool True if media content is present, false otherwise.
|
||||
*/
|
||||
public function containsMedia(): bool
|
||||
{
|
||||
return $this->getPhoto() !== null || $this->getAnimation() !== null || $this->getAudio() !== null || $this->getDocument() !== null || $this->getSticker() !== null || $this->getVideo() !== null || $this->getVideoNote() !== null || $this->getVoice() !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue