Skip to content

Commit

Permalink
Added all optional properties
Browse files Browse the repository at this point in the history
  • Loading branch information
TiiFuchs committed Apr 28, 2022
1 parent e2cce5a commit 22dd17f
Show file tree
Hide file tree
Showing 73 changed files with 384 additions and 384 deletions.
8 changes: 4 additions & 4 deletions src/Telegram/Animation.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class Animation extends \Tii\Telepath\Type
public int $duration;

/** Optional. Animation thumbnail as defined by sender */
public PhotoSize $thumb;
public ?PhotoSize $thumb;

/** Optional. Original animation filename as defined by sender */
public string $file_name;
public ?string $file_name;

/** Optional. MIME type of the file as defined by sender */
public string $mime_type;
public ?string $mime_type;

/** Optional. File size in bytes */
public int $file_size;
public ?int $file_size;
}
12 changes: 6 additions & 6 deletions src/Telegram/Audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ class Audio extends \Tii\Telepath\Type
public int $duration;

/** Optional. Performer of the audio as defined by sender or by audio tags */
public string $performer;
public ?string $performer;

/** Optional. Title of the audio as defined by sender or by audio tags */
public string $title;
public ?string $title;

/** Optional. Original filename as defined by sender */
public string $file_name;
public ?string $file_name;

/** Optional. MIME type of the file as defined by sender */
public string $mime_type;
public ?string $mime_type;

/** Optional. File size in bytes */
public int $file_size;
public ?int $file_size;

/** Optional. Thumbnail of the album cover to which the music file belongs */
public PhotoSize $thumb;
public ?PhotoSize $thumb;
}
8 changes: 4 additions & 4 deletions src/Telegram/CallbackQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ class CallbackQuery extends \Tii\Telepath\Type
public User $from;

/** Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old */
public Message $message;
public ?Message $message;

/** Optional. Identifier of the message sent via the bot in inline mode, that originated the query. */
public string $inline_message_id;
public ?string $inline_message_id;

/** Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. */
public string $chat_instance;

/** Optional. Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field. */
public string $data;
public ?string $data;

/** Optional. Short name of a Game to be returned, serves as the unique identifier for the game */
public string $game_short_name;
public ?string $game_short_name;
}
36 changes: 18 additions & 18 deletions src/Telegram/Chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,56 +18,56 @@ class Chat extends \Tii\Telepath\Type
public string $type;

/** Optional. Title, for supergroups, channels and group chats */
public string $title;
public ?string $title;

/** Optional. Username, for private chats, supergroups and channels if available */
public string $username;
public ?string $username;

/** Optional. First name of the other party in a private chat */
public string $first_name;
public ?string $first_name;

/** Optional. Last name of the other party in a private chat */
public string $last_name;
public ?string $last_name;

/** Optional. Chat photo. Returned only in getChat. */
public ChatPhoto $photo;
public ?ChatPhoto $photo;

/** Optional. Bio of the other party in a private chat. Returned only in getChat. */
public string $bio;
public ?string $bio;

/** Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat. */
public bool $has_private_forwards;
public ?bool $has_private_forwards;

/** Optional. Description, for groups, supergroups and channel chats. Returned only in getChat. */
public string $description;
public ?string $description;

/** Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat. */
public string $invite_link;
public ?string $invite_link;

/** Optional. The most recent pinned message (by sending date). Returned only in getChat. */
public Message $pinned_message;
public ?Message $pinned_message;

/** Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat. */
public ChatPermissions $permissions;
public ?ChatPermissions $permissions;

/** Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat. */
public int $slow_mode_delay;
public ?int $slow_mode_delay;

/** Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat. */
public int $message_auto_delete_time;
public ?int $message_auto_delete_time;

/** Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat. */
public bool $has_protected_content;
public ?bool $has_protected_content;

/** Optional. For supergroups, name of group sticker set. Returned only in getChat. */
public string $sticker_set_name;
public ?string $sticker_set_name;

/** Optional. True, if the bot can change the group sticker set. Returned only in getChat. */
public bool $can_set_sticker_set;
public ?bool $can_set_sticker_set;

/** Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat. */
public int $linked_chat_id;
public ?int $linked_chat_id;

/** Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat. */
public ChatLocation $location;
public ?ChatLocation $location;
}
6 changes: 3 additions & 3 deletions src/Telegram/ChatAdministratorRights.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ class ChatAdministratorRights extends \Tii\Telepath\Type
public bool $can_invite_users;

/** Optional. True, if the administrator can post in the channel; channels only */
public bool $can_post_messages;
public ?bool $can_post_messages;

/** Optional. True, if the administrator can edit messages of other users and can pin messages; channels only */
public bool $can_edit_messages;
public ?bool $can_edit_messages;

/** Optional. True, if the user is allowed to pin messages; groups and supergroups only */
public bool $can_pin_messages;
public ?bool $can_pin_messages;
}
8 changes: 4 additions & 4 deletions src/Telegram/ChatInviteLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class ChatInviteLink extends \Tii\Telepath\Type
public bool $is_revoked;

/** Optional. Invite link name */
public string $name;
public ?string $name;

/** Optional. Point in time (Unix timestamp) when the link will expire or has been expired */
public int $expire_date;
public ?int $expire_date;

/** Optional. Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */
public int $member_limit;
public ?int $member_limit;

/** Optional. Number of pending join requests created using this link */
public int $pending_join_request_count;
public ?int $pending_join_request_count;
}
4 changes: 2 additions & 2 deletions src/Telegram/ChatJoinRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class ChatJoinRequest extends \Tii\Telepath\Type
public int $date;

/** Optional. Bio of the user. */
public string $bio;
public ?string $bio;

/** Optional. Chat invite link that was used by the user to send the join request */
public ChatInviteLink $invite_link;
public ?ChatInviteLink $invite_link;
}
8 changes: 4 additions & 4 deletions src/Telegram/ChatMemberAdministrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ class ChatMemberAdministrator extends ChatMember
public bool $can_invite_users;

/** Optional. True, if the administrator can post in the channel; channels only */
public bool $can_post_messages;
public ?bool $can_post_messages;

/** Optional. True, if the administrator can edit messages of other users and can pin messages; channels only */
public bool $can_edit_messages;
public ?bool $can_edit_messages;

/** Optional. True, if the user is allowed to pin messages; groups and supergroups only */
public bool $can_pin_messages;
public ?bool $can_pin_messages;

/** Optional. Custom title for this user */
public string $custom_title;
public ?string $custom_title;
}
2 changes: 1 addition & 1 deletion src/Telegram/ChatMemberOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ class ChatMemberOwner extends ChatMember
public bool $is_anonymous;

/** Optional. Custom title for this user */
public string $custom_title;
public ?string $custom_title;
}
2 changes: 1 addition & 1 deletion src/Telegram/ChatMemberUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ class ChatMemberUpdated extends \Tii\Telepath\Type
public ChatMember $new_chat_member;

/** Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only. */
public ChatInviteLink $invite_link;
public ?ChatInviteLink $invite_link;
}
16 changes: 8 additions & 8 deletions src/Telegram/ChatPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@
class ChatPermissions extends \Tii\Telepath\Type
{
/** Optional. True, if the user is allowed to send text messages, contacts, locations and venues */
public bool $can_send_messages;
public ?bool $can_send_messages;

/** Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages */
public bool $can_send_media_messages;
public ?bool $can_send_media_messages;

/** Optional. True, if the user is allowed to send polls, implies can_send_messages */
public bool $can_send_polls;
public ?bool $can_send_polls;

/** Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages */
public bool $can_send_other_messages;
public ?bool $can_send_other_messages;

/** Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages */
public bool $can_add_web_page_previews;
public ?bool $can_add_web_page_previews;

/** Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups */
public bool $can_change_info;
public ?bool $can_change_info;

/** Optional. True, if the user is allowed to invite new users to the chat */
public bool $can_invite_users;
public ?bool $can_invite_users;

/** Optional. True, if the user is allowed to pin messages. Ignored in public supergroups */
public bool $can_pin_messages;
public ?bool $can_pin_messages;
}
4 changes: 2 additions & 2 deletions src/Telegram/ChosenInlineResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class ChosenInlineResult extends \Tii\Telepath\Type
public User $from;

/** Optional. Sender location, only for bots that require user location */
public Location $location;
public ?Location $location;

/** Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message. */
public string $inline_message_id;
public ?string $inline_message_id;

/** The query that was used to obtain the result */
public string $query;
Expand Down
6 changes: 3 additions & 3 deletions src/Telegram/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class Contact extends \Tii\Telepath\Type
public string $first_name;

/** Optional. Contact's last name */
public string $last_name;
public ?string $last_name;

/** Optional. Contact's user identifier in Telegram. 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 64-bit integer or double-precision float type are safe for storing this identifier. */
public int $user_id;
public ?int $user_id;

/** Optional. Additional data about the contact in the form of a vCard */
public string $vcard;
public ?string $vcard;
}
8 changes: 4 additions & 4 deletions src/Telegram/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class Document extends \Tii\Telepath\Type
public string $file_unique_id;

/** Optional. Document thumbnail as defined by sender */
public PhotoSize $thumb;
public ?PhotoSize $thumb;

/** Optional. Original filename as defined by sender */
public string $file_name;
public ?string $file_name;

/** Optional. MIME type of the file as defined by sender */
public string $mime_type;
public ?string $mime_type;

/** Optional. File size in bytes */
public int $file_size;
public ?int $file_size;
}
16 changes: 8 additions & 8 deletions src/Telegram/EncryptedPassportElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,34 @@ class EncryptedPassportElement extends \Tii\Telepath\Type
public string $type;

/** Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials. */
public string $data;
public ?string $data;

/** Optional. User's verified phone number, available only for “phone_number” type */
public string $phone_number;
public ?string $phone_number;

/** Optional. User's verified email address, available only for “email” type */
public string $email;
public ?string $email;

/**
* Optional. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
* @var PassportFile[]
*/
public array $files;
public ?array $files;

/** Optional. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. */
public PassportFile $front_side;
public ?PassportFile $front_side;

/** Optional. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials. */
public PassportFile $reverse_side;
public ?PassportFile $reverse_side;

/** Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. */
public PassportFile $selfie;
public ?PassportFile $selfie;

/**
* Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
* @var PassportFile[]
*/
public array $translation;
public ?array $translation;

/** Base64-encoded element hash for using in PassportElementErrorUnspecified */
public string $hash;
Expand Down
4 changes: 2 additions & 2 deletions src/Telegram/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class File extends \Tii\Telepath\Type
public string $file_unique_id;

/** Optional. File size in bytes, if known */
public int $file_size;
public ?int $file_size;

/** Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. */
public string $file_path;
public ?string $file_path;
}
4 changes: 2 additions & 2 deletions src/Telegram/ForceReply.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class ForceReply extends \Tii\Telepath\Type
public bool $force_reply;

/** Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters */
public string $input_field_placeholder;
public ?string $input_field_placeholder;

/** Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. */
public bool $selective;
public ?bool $selective;
}
6 changes: 3 additions & 3 deletions src/Telegram/Game.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class Game extends \Tii\Telepath\Type
public array $photo;

/** Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters. */
public string $text;
public ?string $text;

/**
* Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
* @var MessageEntity[]
*/
public array $text_entities;
public ?array $text_entities;

/** Optional. Animation that will be displayed in the game message in chats. Upload via BotFather */
public Animation $animation;
public ?Animation $animation;
}
Loading

0 comments on commit 22dd17f

Please sign in to comment.