Add EditChatSubscriptionInviteLink method
This commit is contained in:
parent
59af689364
commit
b116ec4447
2 changed files with 46 additions and 0 deletions
43
src/TgBotLib/Methods/EditChatSubscriptionInviteLink.php
Normal file
43
src/TgBotLib/Methods/EditChatSubscriptionInviteLink.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace TgBotLib\Methods;
|
||||
|
||||
use TgBotLib\Abstracts\Method;
|
||||
use TgBotLib\Bot;
|
||||
use TgBotLib\Enums\Methods;
|
||||
use TgBotLib\Objects\ChatInviteLink;
|
||||
|
||||
class EditChatSubscriptionInviteLink extends Method
|
||||
{
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function execute(Bot $bot, array $parameters = []): ChatInviteLink
|
||||
{
|
||||
return ChatInviteLink::fromArray(
|
||||
self::executeCurl(self::buildPost($bot, Methods::EDIT_CHAT_SUBSCRIPTION_INVITE_LINK->value, $parameters))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getRequiredParameters(): ?array
|
||||
{
|
||||
return [
|
||||
'chat_id',
|
||||
'invite_link'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getOptionalParameters(): ?array
|
||||
{
|
||||
return [
|
||||
'name'
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue