Skip to content

Commit

Permalink
Added descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
TiiFuchs committed Apr 28, 2022
1 parent 222a2ac commit e2cce5a
Show file tree
Hide file tree
Showing 131 changed files with 1,682 additions and 181 deletions.
20 changes: 20 additions & 0 deletions src/Telegram/Animation.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,35 @@

namespace Tii\Telepath\Telegram;

/**
* This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
*/
class Animation extends \Tii\Telepath\Type
{
/** Identifier for this file, which can be used to download or reuse the file */
public string $file_id;

/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
public string $file_unique_id;

/** Video width as defined by sender */
public int $width;

/** Video height as defined by sender */
public int $height;

/** Duration of the video in seconds as defined by sender */
public int $duration;

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

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

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

/** Optional. File size in bytes */
public int $file_size;
}
20 changes: 20 additions & 0 deletions src/Telegram/Audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,35 @@

namespace Tii\Telepath\Telegram;

/**
* This object represents an audio file to be treated as music by the Telegram clients.
*/
class Audio extends \Tii\Telepath\Type
{
/** Identifier for this file, which can be used to download or reuse the file */
public string $file_id;

/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
public string $file_unique_id;

/** Duration of the audio in seconds as defined by sender */
public int $duration;

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

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

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

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

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

/** Optional. Thumbnail of the album cover to which the music file belongs */
public PhotoSize $thumb;
}
6 changes: 6 additions & 0 deletions src/Telegram/BotCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@

namespace Tii\Telepath\Telegram;

/**
* This object represents a bot command.
*/
class BotCommand extends \Tii\Telepath\Type
{
/** Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. */
public string $command;

/** Description of the command; 1-256 characters. */
public string $description;
}
3 changes: 3 additions & 0 deletions src/Telegram/BotCommandScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace Tii\Telepath\Telegram;

/**
* This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:
*/
class BotCommandScope extends \Tii\Telepath\Type
{
}
4 changes: 3 additions & 1 deletion src/Telegram/BotCommandScopeAllChatAdministrators.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

namespace Tii\Telepath\Telegram;

/**
* Represents the scope of bot commands, covering all group and supergroup chat administrators.
*/
class BotCommandScopeAllChatAdministrators extends BotCommandScope
{
public string $type;
}
4 changes: 3 additions & 1 deletion src/Telegram/BotCommandScopeAllGroupChats.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

namespace Tii\Telepath\Telegram;

/**
* Represents the scope of bot commands, covering all group and supergroup chats.
*/
class BotCommandScopeAllGroupChats extends BotCommandScope
{
public string $type;
}
4 changes: 3 additions & 1 deletion src/Telegram/BotCommandScopeAllPrivateChats.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

namespace Tii\Telepath\Telegram;

/**
* Represents the scope of bot commands, covering all private chats.
*/
class BotCommandScopeAllPrivateChats extends BotCommandScope
{
public string $type;
}
5 changes: 4 additions & 1 deletion src/Telegram/BotCommandScopeChat.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

namespace Tii\Telepath\Telegram;

/**
* Represents the scope of bot commands, covering a specific chat.
*/
class BotCommandScopeChat extends BotCommandScope
{
public string $type;
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
public int|string $chat_id;
}
5 changes: 4 additions & 1 deletion src/Telegram/BotCommandScopeChatAdministrators.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

namespace Tii\Telepath\Telegram;

/**
* Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
*/
class BotCommandScopeChatAdministrators extends BotCommandScope
{
public string $type;
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
public int|string $chat_id;
}
7 changes: 6 additions & 1 deletion src/Telegram/BotCommandScopeChatMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@

namespace Tii\Telepath\Telegram;

/**
* Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
*/
class BotCommandScopeChatMember extends BotCommandScope
{
public string $type;
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
public int|string $chat_id;

/** Unique identifier of the target user */
public int $user_id;
}
4 changes: 3 additions & 1 deletion src/Telegram/BotCommandScopeDefault.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

namespace Tii\Telepath\Telegram;

/**
* Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.
*/
class BotCommandScopeDefault extends BotCommandScope
{
public string $type;
}
16 changes: 16 additions & 0 deletions src/Telegram/CallbackQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,29 @@

namespace Tii\Telepath\Telegram;

/**
* 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
{
/** Unique identifier for this query */
public string $id;

/** Sender */
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;

/** Optional. Identifier of the message sent via the bot in inline mode, that originated the query. */
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;

/** Optional. Short name of a Game to be returned, serves as the unique identifier for the game */
public string $game_short_name;
}
42 changes: 42 additions & 0 deletions src/Telegram/Chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,68 @@

namespace Tii\Telepath\Telegram;

/**
* This object represents a chat.
*/
class Chat extends \Tii\Telepath\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;

/** Type of chat, can be either “private”, “group”, “supergroup” or “channel” */
public string $type;

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

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

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

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

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

/** Optional. Bio of the other party in a private chat. Returned only in getChat. */
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;

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

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

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

/** Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat. */
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;

/** 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;

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

/** Optional. For supergroups, name of group sticker set. Returned only in getChat. */
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;

/** 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;

/** Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat. */
public ChatLocation $location;
}
24 changes: 24 additions & 0 deletions src/Telegram/ChatAdministratorRights.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,41 @@

namespace Tii\Telepath\Telegram;

/**
* Represents the rights of an administrator in a chat.
*/
class ChatAdministratorRights extends \Tii\Telepath\Type
{
/** True, if the user's presence in the chat is hidden */
public bool $is_anonymous;

/** True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege */
public bool $can_manage_chat;

/** True, if the administrator can delete messages of other users */
public bool $can_delete_messages;

/** True, if the administrator can manage video chats */
public bool $can_manage_video_chats;

/** True, if the administrator can restrict, ban or unban chat members */
public bool $can_restrict_members;

/** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
public bool $can_promote_members;

/** True, if the user is allowed to change the chat title, photo and other settings */
public bool $can_change_info;

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

/** Optional. True, if the administrator can post in the channel; channels only */
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;

/** Optional. True, if the user is allowed to pin messages; groups and supergroups only */
public bool $can_pin_messages;
}
20 changes: 20 additions & 0 deletions src/Telegram/ChatInviteLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,35 @@

namespace Tii\Telepath\Telegram;

/**
* Represents an invite link for a chat.
*/
class ChatInviteLink extends \Tii\Telepath\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;

/** Creator of the link */
public User $creator;

/** True, if users joining the chat via the link need to be approved by chat administrators */
public bool $creates_join_request;

/** True, if the link is primary */
public bool $is_primary;

/** True, if the link is revoked */
public bool $is_revoked;

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

/** Optional. Point in time (Unix timestamp) when the link will expire or has been expired */
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;

/** Optional. Number of pending join requests created using this link */
public int $pending_join_request_count;
}
12 changes: 12 additions & 0 deletions src/Telegram/ChatJoinRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,23 @@

namespace Tii\Telepath\Telegram;

/**
* Represents a join request sent to a chat.
*/
class ChatJoinRequest extends \Tii\Telepath\Type
{
/** Chat to which the request was sent */
public Chat $chat;

/** User that sent the join request */
public User $from;

/** Date the request was sent in Unix time */
public int $date;

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

/** Optional. Chat invite link that was used by the user to send the join request */
public ChatInviteLink $invite_link;
}
6 changes: 6 additions & 0 deletions src/Telegram/ChatLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@

namespace Tii\Telepath\Telegram;

/**
* Represents a location to which a chat is connected.
*/
class ChatLocation extends \Tii\Telepath\Type
{
/** The location to which the supergroup is connected. Can't be a live location. */
public Location $location;

/** Location address; 1-64 characters, as defined by the chat owner */
public string $address;
}
Loading

0 comments on commit e2cce5a

Please sign in to comment.