You can make custom requests to API using the call()
method and CustomMethod
object:
use Vjik\TelegramBot\Api\CustomMethod;
/**
* @var \Vjik\TelegramBot\Api\TelegramBotApi $api
*/
$method = new CustomMethod(
apiMethod: 'getChat',
data: ['chat_id' => '@sergei_predvoditelev'],
resultType: ChatFullInfo::class,
httpMethod: HttpMethod::GET,
);
// Result is an object of `Vjik\TelegramBot\Api\Type\ChatFullInfo`
$result = $api->call($method);