Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
TiiFuchs committed May 10, 2022
1 parent 87e2788 commit 94d1c48
Show file tree
Hide file tree
Showing 85 changed files with 93 additions and 93 deletions.
2 changes: 1 addition & 1 deletion src/Layer/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use GuzzleHttp\Client;
use Tii\Telepath\CastsToTelegramTypes;
use Tii\Telepath\Exceptions\TelegramException;
use Tii\Telepath\InputFile;
use Tii\Telepath\Types\InputFile;
use Tii\Telepath\Telegram\Update;
use Tii\Telepath\Telegram\User;

Expand Down
2 changes: 1 addition & 1 deletion src/Layer/Generated.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Tii\Telepath\Layer;

use Tii\Telepath\InputFile;
use Tii\Telepath\Types\InputFile;
use Tii\Telepath\Telegram\BotCommand;
use Tii\Telepath\Telegram\BotCommandScope;
use Tii\Telepath\Telegram\ChatAdministratorRights;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/Animation.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
*/
class Animation extends \Tii\Telepath\Type
class Animation extends \Tii\Telepath\Types\Type
{
/** Identifier for this file, which can be used to download or reuse the file */
public string $file_id;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/Audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents an audio file to be treated as music by the Telegram clients.
*/
class Audio extends \Tii\Telepath\Type
class Audio extends \Tii\Telepath\Types\Type
{
/** Identifier for this file, which can be used to download or reuse the file */
public string $file_id;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/BotCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents a bot command.
*/
class BotCommand extends \Tii\Telepath\Type
class BotCommand extends \Tii\Telepath\Types\Type
{
/** Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. */
public string $command;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/BotCommandScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:
*/
abstract class BotCommandScope extends \Tii\Telepath\Type
abstract class BotCommandScope extends \Tii\Telepath\Types\Type
{
/** Scope type */
public string $type;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/CallbackQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.
*/
class CallbackQuery extends \Tii\Telepath\Type
class CallbackQuery extends \Tii\Telepath\Types\Type
{
/** Unique identifier for this query */
public string $id;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/Chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents a chat.
*/
class Chat extends \Tii\Telepath\Type
class Chat extends \Tii\Telepath\Types\Type
{
/** Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */
public int $id;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/ChatAdministratorRights.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Represents the rights of an administrator in a chat.
*/
class ChatAdministratorRights extends \Tii\Telepath\Type
class ChatAdministratorRights extends \Tii\Telepath\Types\Type
{
/** True, if the user's presence in the chat is hidden */
public bool $is_anonymous;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/ChatInviteLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Represents an invite link for a chat.
*/
class ChatInviteLink extends \Tii\Telepath\Type
class ChatInviteLink extends \Tii\Telepath\Types\Type
{
/** The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”. */
public string $invite_link;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/ChatJoinRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Represents a join request sent to a chat.
*/
class ChatJoinRequest extends \Tii\Telepath\Type
class ChatJoinRequest extends \Tii\Telepath\Types\Type
{
/** Chat to which the request was sent */
public Chat $chat;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/ChatLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Represents a location to which a chat is connected.
*/
class ChatLocation extends \Tii\Telepath\Type
class ChatLocation extends \Tii\Telepath\Types\Type
{
/** The location to which the supergroup is connected. Can't be a live location. */
public Location $location;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/ChatMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
*/
abstract class ChatMember extends \Tii\Telepath\Type
abstract class ChatMember extends \Tii\Telepath\Types\Type
{
/** The member's status in the chat */
public string $status;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/ChatMemberUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents changes in the status of a chat member.
*/
class ChatMemberUpdated extends \Tii\Telepath\Type
class ChatMemberUpdated extends \Tii\Telepath\Types\Type
{
/** Chat the user belongs to */
public Chat $chat;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/ChatPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Describes actions that a non-administrator user is allowed to take in a chat.
*/
class ChatPermissions extends \Tii\Telepath\Type
class ChatPermissions extends \Tii\Telepath\Types\Type
{
/** Optional. True, if the user is allowed to send text messages, contacts, locations and venues */
public ?bool $can_send_messages = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/ChatPhoto.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents a chat photo.
*/
class ChatPhoto extends \Tii\Telepath\Type
class ChatPhoto extends \Tii\Telepath\Types\Type
{
/** File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. */
public string $small_file_id;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/ChosenInlineResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Represents a result of an inline query that was chosen by the user and sent to their chat partner.
*/
class ChosenInlineResult extends \Tii\Telepath\Type
class ChosenInlineResult extends \Tii\Telepath\Types\Type
{
/** The unique identifier for the result that was chosen */
public string $result_id;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents a phone contact.
*/
class Contact extends \Tii\Telepath\Type
class Contact extends \Tii\Telepath\Types\Type
{
/** Contact's phone number */
public string $phone_number;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/Dice.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents an animated emoji that displays a random value.
*/
class Dice extends \Tii\Telepath\Type
class Dice extends \Tii\Telepath\Types\Type
{
/** Emoji on which the dice throw animation is based */
public string $emoji;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents a general file (as opposed to photos, voice messages and audio files).
*/
class Document extends \Tii\Telepath\Type
class Document extends \Tii\Telepath\Types\Type
{
/** Identifier for this file, which can be used to download or reuse the file */
public string $file_id;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/EncryptedCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Contains data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
*/
class EncryptedCredentials extends \Tii\Telepath\Type
class EncryptedCredentials extends \Tii\Telepath\Types\Type
{
/** Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication */
public string $data;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/EncryptedPassportElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Contains information about documents or other Telegram Passport elements shared with the bot by the user.
*/
class EncryptedPassportElement extends \Tii\Telepath\Type
class EncryptedPassportElement extends \Tii\Telepath\Types\Type
{
/** Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”. */
public string $type;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.
*/
class File extends \Tii\Telepath\Type
class File extends \Tii\Telepath\Types\Type
{
/** Identifier for this file, which can be used to download or reuse the file */
public string $file_id;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/ForceReply.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.
*/
class ForceReply extends \Tii\Telepath\Type
class ForceReply extends \Tii\Telepath\Types\Type
{
/** Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply' */
public bool $force_reply;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/Game.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
*/
class Game extends \Tii\Telepath\Type
class Game extends \Tii\Telepath\Types\Type
{
/** Title of the game */
public string $title;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/GameHighScore.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents one row of the high scores table for a game.
*/
class GameHighScore extends \Tii\Telepath\Type
class GameHighScore extends \Tii\Telepath\Types\Type
{
/** Position in high score table for the game */
public int $position;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/InlineKeyboardButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
*/
class InlineKeyboardButton extends \Tii\Telepath\Type
class InlineKeyboardButton extends \Tii\Telepath\Types\Type
{
/** Label text on the button */
public string $text;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/InlineKeyboardMarkup.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents an inline keyboard that appears right next to the message it belongs to.
*/
class InlineKeyboardMarkup extends \Tii\Telepath\Type
class InlineKeyboardMarkup extends \Tii\Telepath\Types\Type
{
/**
* Array of button rows, each represented by an Array of InlineKeyboardButton objects
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/InlineQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
*/
class InlineQuery extends \Tii\Telepath\Type
class InlineQuery extends \Tii\Telepath\Types\Type
{
/** Unique identifier for this query */
public string $id;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/InlineQueryResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:
*/
abstract class InlineQueryResult extends \Tii\Telepath\Type
abstract class InlineQueryResult extends \Tii\Telepath\Types\Type
{
/** Type of the result */
public string $type;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/InputMedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This object represents the content of a media message to be sent. It should be one of
*/
abstract class InputMedia extends \Tii\Telepath\Type
abstract class InputMedia extends \Tii\Telepath\Types\Type
{
/** Type of the result */
public string $type;
Expand Down
6 changes: 3 additions & 3 deletions src/Telegram/InputMediaAnimation.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class InputMediaAnimation extends InputMedia
public string $type = 'animation';

/** Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » */
public \Tii\Telepath\InputFile|string|null $thumb = null;
public \Tii\Telepath\Types\InputFile|string|null $thumb = null;

/** Optional. Animation width */
public ?int $width = null;
Expand All @@ -28,7 +28,7 @@ class InputMediaAnimation extends InputMedia

/**
* @param string $media File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files »
* @param \Tii\Telepath\InputFile|string $thumb Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
* @param \Tii\Telepath\Types\InputFile|string $thumb Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
* @param string $caption Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing
* @param string $parse_mode Optional. Mode for parsing entities in the animation caption. See formatting options for more details.
* @param MessageEntity[] $caption_entities Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
Expand All @@ -38,7 +38,7 @@ class InputMediaAnimation extends InputMedia
*/
public static function make(
string $media,
\Tii\Telepath\InputFile|string|null $thumb = null,
\Tii\Telepath\Types\InputFile|string|null $thumb = null,
?string $caption = null,
?string $parse_mode = null,
?array $caption_entities = null,
Expand Down
6 changes: 3 additions & 3 deletions src/Telegram/InputMediaAudio.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class InputMediaAudio extends InputMedia
public string $type = 'audio';

/** Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » */
public \Tii\Telepath\InputFile|string|null $thumb = null;
public \Tii\Telepath\Types\InputFile|string|null $thumb = null;

/** Optional. Duration of the audio in seconds */
public ?int $duration = null;
Expand All @@ -28,7 +28,7 @@ class InputMediaAudio extends InputMedia

/**
* @param string $media File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files »
* @param \Tii\Telepath\InputFile|string $thumb Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
* @param \Tii\Telepath\Types\InputFile|string $thumb Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
* @param string $caption Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing
* @param string $parse_mode Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
* @param MessageEntity[] $caption_entities Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
Expand All @@ -38,7 +38,7 @@ class InputMediaAudio extends InputMedia
*/
public static function make(
string $media,
\Tii\Telepath\InputFile|string|null $thumb = null,
\Tii\Telepath\Types\InputFile|string|null $thumb = null,
?string $caption = null,
?string $parse_mode = null,
?array $caption_entities = null,
Expand Down
Loading

0 comments on commit 94d1c48

Please sign in to comment.