Add 'GetUserProfilePhotos' method support
This commit is contained in:
parent
ee2dff1e31
commit
44260ccaee
2 changed files with 43 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
|||
use TgBotLib\Methods\ForwardMessages;
|
||||
use TgBotLib\Methods\GetMe;
|
||||
use TgBotLib\Methods\GetUpdates;
|
||||
use TgBotLib\Methods\GetUserProfilePhotos;
|
||||
use TgBotLib\Methods\GetWebhookInfo;
|
||||
use TgBotLib\Methods\Logout;
|
||||
use TgBotLib\Methods\SendAnimation;
|
||||
|
@ -64,6 +65,7 @@
|
|||
case SEND_DICE = 'sendDice';
|
||||
case SEND_CHAT_ACTION = 'sendChatAction';
|
||||
case SET_MESSAGE_REACTION = 'setMessageReaction';
|
||||
case GET_USER_PROFILE_PHOTOS = 'getUserProfilePhotos';
|
||||
|
||||
/**
|
||||
* Executes a command on the provided bot with the given parameters.
|
||||
|
@ -105,6 +107,7 @@
|
|||
self::SEND_DICE => SendDice::execute($bot, $parameters),
|
||||
self::SEND_CHAT_ACTION => SendChatAction::execute($bot, $parameters),
|
||||
self::SET_MESSAGE_REACTION => SetMessageReaction::execute($bot, $parameters),
|
||||
self::GET_USER_PROFILE_PHOTOS => GetUserProfilePhotos::execute($bot, $parameters),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
40
src/TgBotLib/Methods/GetUserProfilePhotos.php
Normal file
40
src/TgBotLib/Methods/GetUserProfilePhotos.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace TgBotLib\Methods;
|
||||
|
||||
use TgBotLib\Abstracts\Method;
|
||||
use TgBotLib\Bot;
|
||||
use TgBotLib\Enums\Methods;
|
||||
use TgBotLib\Objects\UserProfilePhotos;
|
||||
|
||||
class GetUserProfilePhotos extends Method
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function execute(Bot $bot, array $parameters = []): UserProfilePhotos
|
||||
{
|
||||
return $bot->sendRequest(Methods::GET_USER_PROFILE_PHOTOS->value, $parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getRequiredParameters(): ?array
|
||||
{
|
||||
return [
|
||||
'user_id'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getOptionalParameters(): ?array
|
||||
{
|
||||
return [
|
||||
'offset',
|
||||
'limit'
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue