Add EditChatInviteLink method to the library

This commit is contained in:
netkas 2024-11-06 15:01:52 -05:00
parent 6315f5840d
commit 24fe2f2b91
2 changed files with 46 additions and 0 deletions

View 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 EditChatInviteLink extends Method
{
/**
* @inheritDoc
*/
public static function execute(Bot $bot, array $parameters = []): ChatInviteLink
{
return ChatInviteLink::fromArray($bot->sendRequest(Methods::EDIT_CHAT_INVITE_LINK->value, $parameters));
}
/**
* @inheritDoc
*/
public static function getRequiredParameters(): ?array
{
return [
'chat_id',
'invite_link'
];
}
/**
* @inheritDoc
*/
public static function getOptionalParameters(): ?array
{
return [
'name',
'expire_date',
'member_limit',
'creates_join_request'
];
}
}