Add support for Paid Media Purchased event
This commit is contained in:
parent
39821585e4
commit
c57cdfe05c
3 changed files with 35 additions and 0 deletions
28
src/TgBotLib/Events/PaidMediaPurchasedEvent.php
Normal file
28
src/TgBotLib/Events/PaidMediaPurchasedEvent.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\UpdateEventType;
|
||||
use TgBotLib\Objects\Payments\PaidMediaPurchased;
|
||||
|
||||
abstract class PaidMediaPurchasedEvent extends UpdateEvent
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getEventType(): UpdateEventType
|
||||
{
|
||||
return UpdateEventType::PAID_MEDIA_PURCHASED;
|
||||
}
|
||||
|
||||
/**
|
||||
* A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat
|
||||
*
|
||||
* @return PaidMediaPurchased
|
||||
*/
|
||||
protected function getPurchasedPaidMedia(): PaidMediaPurchased
|
||||
{
|
||||
return $this->update->getPurchasedPaidMedia();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue