Add support for Paid Media Purchased event

This commit is contained in:
netkas 2024-11-01 21:30:41 -04:00
parent 39821585e4
commit c57cdfe05c
3 changed files with 35 additions and 0 deletions

View 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();
}
}