forked from TelegramBot/Api
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
138 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Luzrain\TelegramBotApi\Method; | ||
|
||
use Luzrain\TelegramBotApi\Method; | ||
use Luzrain\TelegramBotApi\Type\ChatInviteLink; | ||
|
||
/** | ||
* Use this method to create a subscription invite link for a channel chat. | ||
* The bot must have the can_invite_users administrator rights. | ||
* The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. | ||
* Returns the new invite link as a ChatInviteLink object. | ||
* | ||
* @see https://telegram.org/blog/superchannels-star-reactions-subscriptions#star-subscriptions | ||
* | ||
* @extends Method<ChatInviteLink> | ||
*/ | ||
final class CreateChatSubscriptionInviteLink extends Method | ||
{ | ||
protected static string $methodName = 'createChatSubscriptionInviteLink'; | ||
protected static string $responseClass = ChatInviteLink::class; | ||
|
||
public function __construct( | ||
/** | ||
* Unique identifier for the target channel chat or username of the target channel (in the format @channelusername) | ||
*/ | ||
protected int|string $chatId, | ||
|
||
/** | ||
* The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days). | ||
*/ | ||
protected int $subscriptionPeriod, | ||
|
||
/** | ||
* The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500 | ||
*/ | ||
protected int $subscriptionPrice, | ||
|
||
/** | ||
* Invite link name; 0-32 characters | ||
*/ | ||
protected string|null $name = null, | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Luzrain\TelegramBotApi\Method; | ||
|
||
use Luzrain\TelegramBotApi\Method; | ||
use Luzrain\TelegramBotApi\Type\ChatInviteLink; | ||
|
||
/** | ||
* Use this method to edit a subscription invite link created by the bot. | ||
* The bot must have the can_invite_users administrator rights. | ||
* Returns the edited invite link as a ChatInviteLink object. | ||
* | ||
* @extends Method<ChatInviteLink> | ||
*/ | ||
final class EditChatSubscriptionInviteLink extends Method | ||
{ | ||
protected static string $methodName = 'editChatSubscriptionInviteLink'; | ||
protected static string $responseClass = ChatInviteLink::class; | ||
|
||
public function __construct( | ||
/** | ||
* Unique identifier for the target chat or username of the target channel (in the format @channelusername) | ||
*/ | ||
protected int|string $chatId, | ||
|
||
/** | ||
* The invite link to edit | ||
*/ | ||
protected string $inviteLink, | ||
|
||
/** | ||
* Invite link name; 0-32 characters | ||
*/ | ||
protected string|null $name = null, | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Luzrain\TelegramBotApi\Type; | ||
|
||
/** | ||
* The reaction is paid. | ||
*/ | ||
final readonly class ReactionTypePaid extends ReactionType | ||
{ | ||
public const TYPE = 'paid'; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(self::TYPE); | ||
} | ||
} |