Updated PhpDocs

This commit is contained in:
netkas 2024-10-07 22:04:26 -04:00
parent 17ff223461
commit 5e52ceea4b
5 changed files with 44 additions and 5 deletions

View file

@ -5,11 +5,20 @@
use TgBotLib\Abstracts\Method; use TgBotLib\Abstracts\Method;
use TgBotLib\Bot; use TgBotLib\Bot;
use TgBotLib\Enums\Methods; use TgBotLib\Enums\Methods;
use TgBotLib\Exceptions\TelegramException;
class Close extends Method class Close extends Method
{ {
/** /**
* @inheritDoc * Use this method to close the bot instance before moving it from one local server to another.
* You need to delete the webhook before calling this method to ensure that the bot isn't launched again
* after server restart. The method will return error 429 in the first 10 minutes after the bot is launched.
* Returns True on success. Requires no parameters.
*
* @param Bot $bot
* @param array $parameters
* @return bool
* @throws TelegramException
*/ */
public static function execute(Bot $bot, array $parameters = []): bool public static function execute(Bot $bot, array $parameters = []): bool
{ {

View file

@ -6,12 +6,19 @@ use InvalidArgumentException;
use TgBotLib\Abstracts\Method; use TgBotLib\Abstracts\Method;
use TgBotLib\Bot; use TgBotLib\Bot;
use TgBotLib\Enums\Methods; use TgBotLib\Enums\Methods;
use TgBotLib\Exceptions\TelegramException;
use TgBotLib\Objects\Message; use TgBotLib\Objects\Message;
class ForwardMessage extends Method class ForwardMessage extends Method
{ {
/** /**
* @inheritDoc * Use this method to forward messages of any kind. Service messages and messages with protected content can't be
* forwarded. On success, the sent Message is returned.
*
* @param Bot $bot
* @param array $parameters
* @return Message
* @throws TelegramException
*/ */
public static function execute(Bot $bot, array $parameters = []): Message public static function execute(Bot $bot, array $parameters = []): Message
{ {

View file

@ -5,12 +5,19 @@
use TgBotLib\Abstracts\Method; use TgBotLib\Abstracts\Method;
use TgBotLib\Bot; use TgBotLib\Bot;
use TgBotLib\Enums\Methods; use TgBotLib\Enums\Methods;
use TgBotLib\Exceptions\TelegramException;
use TgBotLib\Objects\User; use TgBotLib\Objects\User;
class GetMe extends Method class GetMe extends Method
{ {
/** /**
* @inheritDoc * A simple method for testing your bot's authentication token. Requires no parameters.
* Returns basic information about the bot in form of a User object.
*
* @param Bot $bot
* @param array $parameters
* @return User
* @throws TelegramException
*/ */
public static function execute(Bot $bot, array $parameters=[]): User public static function execute(Bot $bot, array $parameters=[]): User
{ {

View file

@ -5,11 +5,21 @@
use TgBotLib\Abstracts\Method; use TgBotLib\Abstracts\Method;
use TgBotLib\Bot; use TgBotLib\Bot;
use TgBotLib\Enums\Methods; use TgBotLib\Enums\Methods;
use TgBotLib\Exceptions\TelegramException;
class Logout extends Method class Logout extends Method
{ {
/** /**
* @inheritDoc * Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out
* the bot before running it locally, otherwise there is no guarantee that the bot will receive updates.
* After a successful call, you can immediately log in on a local server, but will not be able to log in back
* to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters.
*
* @param Bot $bot
* @param array $parameters
* @return bool
* @throws TelegramException
*/ */
public static function execute(Bot $bot, array $parameters=[]): bool public static function execute(Bot $bot, array $parameters=[]): bool
{ {

View file

@ -7,6 +7,7 @@
use TgBotLib\Bot; use TgBotLib\Bot;
use TgBotLib\Enums\Methods; use TgBotLib\Enums\Methods;
use TgBotLib\Enums\Types\ParseMode; use TgBotLib\Enums\Types\ParseMode;
use TgBotLib\Exceptions\TelegramException;
use TgBotLib\Interfaces\ObjectTypeInterface; use TgBotLib\Interfaces\ObjectTypeInterface;
use TgBotLib\Objects\LinkPreviewOptions; use TgBotLib\Objects\LinkPreviewOptions;
use TgBotLib\Objects\Message; use TgBotLib\Objects\Message;
@ -16,7 +17,12 @@
class SendMessage extends Method class SendMessage extends Method
{ {
/** /**
* @inheritDoc * Use this method to send text messages. On success, the sent Message is returned.
*
* @param Bot $bot
* @param array $parameters
* @return Message
* @throws TelegramException
*/ */
public static function execute(Bot $bot, array $parameters=[]): Message public static function execute(Bot $bot, array $parameters=[]): Message
{ {