tgbotlib/src/TgBotLib/Methods/EditChatInviteLink.php

43 lines
No EOL
1,016 B
PHP

<?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'
];
}
}