Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
655 changes: 565 additions & 90 deletions src/Layers/Generated.php

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions src/Telegram/AcceptedGiftTypes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

/**
* This file is auto-generated.
*/

namespace Telepath\Telegram;

use Telepath\Types\Type;

/**
* This object describes the types of gifts that can be gifted to a user or a chat.
*/
class AcceptedGiftTypes extends Type
{
/** <em>True</em>, if unlimited regular gifts are accepted */
public bool $unlimited_gifts;

/** <em>True</em>, if limited regular gifts are accepted */
public bool $limited_gifts;

/** <em>True</em>, if unique gifts or gifts that can be upgraded to unique for free are accepted */
public bool $unique_gifts;

/** <em>True</em>, if a Telegram Premium subscription is accepted */
public bool $premium_subscription;

/**
* @param bool $unlimited_gifts <em>True</em>, if unlimited regular gifts are accepted
* @param bool $limited_gifts <em>True</em>, if limited regular gifts are accepted
* @param bool $unique_gifts <em>True</em>, if unique gifts or gifts that can be upgraded to unique for free are accepted
* @param bool $premium_subscription <em>True</em>, if a Telegram Premium subscription is accepted
*/
public static function make(
bool $unlimited_gifts,
bool $limited_gifts,
bool $unique_gifts,
bool $premium_subscription,
): static {
return new static([
'unlimited_gifts' => $unlimited_gifts,
'limited_gifts' => $limited_gifts,
'unique_gifts' => $unique_gifts,
'premium_subscription' => $premium_subscription,
]);
}
}
4 changes: 2 additions & 2 deletions src/Telegram/BotCommandScopeChat.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class BotCommandScopeChat extends BotCommandScope
/** Scope type, must be <em>chat</em> */
public string $type = 'chat';

/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel direct messages chats and channel chats aren't supported. */
public int|string $chat_id;

/**
* @param int|string $chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
* @param int|string $chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel direct messages chats and channel chats aren't supported.
*/
public static function make(int|string $chat_id): static
{
Expand Down
4 changes: 2 additions & 2 deletions src/Telegram/BotCommandScopeChatAdministrators.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class BotCommandScopeChatAdministrators extends BotCommandScope
/** Scope type, must be <em>chat_administrators</em> */
public string $type = 'chat_administrators';

/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel direct messages chats and channel chats aren't supported. */
public int|string $chat_id;

/**
* @param int|string $chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
* @param int|string $chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel direct messages chats and channel chats aren't supported.
*/
public static function make(int|string $chat_id): static
{
Expand Down
4 changes: 2 additions & 2 deletions src/Telegram/BotCommandScopeChatMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ class BotCommandScopeChatMember extends BotCommandScope
/** Scope type, must be <em>chat_member</em> */
public string $type = 'chat_member';

/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel direct messages chats and channel chats aren't supported. */
public int|string $chat_id;

/** Unique identifier of the target user */
public int $user_id;

/**
* @param int|string $chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
* @param int|string $chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel direct messages chats and channel chats aren't supported.
* @param int $user_id Unique identifier of the target user
*/
public static function make(int|string $chat_id, int $user_id): static
Expand Down
107 changes: 107 additions & 0 deletions src/Telegram/BusinessBotRights.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?php

/**
* This file is auto-generated.
*/

namespace Telepath\Telegram;

use Telepath\Types\Type;

/**
* Represents the rights of a business bot.
*/
class BusinessBotRights extends Type
{
/** <em>Optional</em>. <em>True</em>, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours */
public ?bool $can_reply = null;

/** <em>Optional</em>. <em>True</em>, if the bot can mark incoming private messages as read */
public ?bool $can_read_messages = null;

/** <em>Optional</em>. <em>True</em>, if the bot can delete messages sent by the bot */
public ?bool $can_delete_sent_messages = null;

/** <em>Optional</em>. <em>True</em>, if the bot can delete all private messages in managed chats */
public ?bool $can_delete_all_messages = null;

/** <em>Optional</em>. <em>True</em>, if the bot can edit the first and last name of the business account */
public ?bool $can_edit_name = null;

/** <em>Optional</em>. <em>True</em>, if the bot can edit the bio of the business account */
public ?bool $can_edit_bio = null;

/** <em>Optional</em>. <em>True</em>, if the bot can edit the profile photo of the business account */
public ?bool $can_edit_profile_photo = null;

/** <em>Optional</em>. <em>True</em>, if the bot can edit the username of the business account */
public ?bool $can_edit_username = null;

/** <em>Optional</em>. <em>True</em>, if the bot can change the privacy settings pertaining to gifts for the business account */
public ?bool $can_change_gift_settings = null;

/** <em>Optional</em>. <em>True</em>, if the bot can view gifts and the amount of Telegram Stars owned by the business account */
public ?bool $can_view_gifts_and_stars = null;

/** <em>Optional</em>. <em>True</em>, if the bot can convert regular gifts owned by the business account to Telegram Stars */
public ?bool $can_convert_gifts_to_stars = null;

/** <em>Optional</em>. <em>True</em>, if the bot can transfer and upgrade gifts owned by the business account */
public ?bool $can_transfer_and_upgrade_gifts = null;

/** <em>Optional</em>. <em>True</em>, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts */
public ?bool $can_transfer_stars = null;

/** <em>Optional</em>. <em>True</em>, if the bot can post, edit and delete stories on behalf of the business account */
public ?bool $can_manage_stories = null;

/**
* @param bool $can_reply <em>Optional</em>. <em>True</em>, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours
* @param bool $can_read_messages <em>Optional</em>. <em>True</em>, if the bot can mark incoming private messages as read
* @param bool $can_delete_sent_messages <em>Optional</em>. <em>True</em>, if the bot can delete messages sent by the bot
* @param bool $can_delete_all_messages <em>Optional</em>. <em>True</em>, if the bot can delete all private messages in managed chats
* @param bool $can_edit_name <em>Optional</em>. <em>True</em>, if the bot can edit the first and last name of the business account
* @param bool $can_edit_bio <em>Optional</em>. <em>True</em>, if the bot can edit the bio of the business account
* @param bool $can_edit_profile_photo <em>Optional</em>. <em>True</em>, if the bot can edit the profile photo of the business account
* @param bool $can_edit_username <em>Optional</em>. <em>True</em>, if the bot can edit the username of the business account
* @param bool $can_change_gift_settings <em>Optional</em>. <em>True</em>, if the bot can change the privacy settings pertaining to gifts for the business account
* @param bool $can_view_gifts_and_stars <em>Optional</em>. <em>True</em>, if the bot can view gifts and the amount of Telegram Stars owned by the business account
* @param bool $can_convert_gifts_to_stars <em>Optional</em>. <em>True</em>, if the bot can convert regular gifts owned by the business account to Telegram Stars
* @param bool $can_transfer_and_upgrade_gifts <em>Optional</em>. <em>True</em>, if the bot can transfer and upgrade gifts owned by the business account
* @param bool $can_transfer_stars <em>Optional</em>. <em>True</em>, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts
* @param bool $can_manage_stories <em>Optional</em>. <em>True</em>, if the bot can post, edit and delete stories on behalf of the business account
*/
public static function make(
?bool $can_reply = null,
?bool $can_read_messages = null,
?bool $can_delete_sent_messages = null,
?bool $can_delete_all_messages = null,
?bool $can_edit_name = null,
?bool $can_edit_bio = null,
?bool $can_edit_profile_photo = null,
?bool $can_edit_username = null,
?bool $can_change_gift_settings = null,
?bool $can_view_gifts_and_stars = null,
?bool $can_convert_gifts_to_stars = null,
?bool $can_transfer_and_upgrade_gifts = null,
?bool $can_transfer_stars = null,
?bool $can_manage_stories = null,
): static {
return new static([
'can_reply' => $can_reply,
'can_read_messages' => $can_read_messages,
'can_delete_sent_messages' => $can_delete_sent_messages,
'can_delete_all_messages' => $can_delete_all_messages,
'can_edit_name' => $can_edit_name,
'can_edit_bio' => $can_edit_bio,
'can_edit_profile_photo' => $can_edit_profile_photo,
'can_edit_username' => $can_edit_username,
'can_change_gift_settings' => $can_change_gift_settings,
'can_view_gifts_and_stars' => $can_view_gifts_and_stars,
'can_convert_gifts_to_stars' => $can_convert_gifts_to_stars,
'can_transfer_and_upgrade_gifts' => $can_transfer_and_upgrade_gifts,
'can_transfer_stars' => $can_transfer_stars,
'can_manage_stories' => $can_manage_stories,
]);
}
}
16 changes: 8 additions & 8 deletions src/Telegram/BusinessConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,35 @@ class BusinessConnection extends Type
/** Date the connection was established in Unix time */
public int $date;

/** True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours */
public bool $can_reply;

/** True, if the connection is active */
/** <em>True</em>, if the connection is active */
public bool $is_enabled;

/** <em>Optional</em>. Rights of the business bot */
public ?BusinessBotRights $rights = null;

/**
* @param string $id Unique identifier of the business connection
* @param User $user Business account user that created the business connection
* @param int $user_chat_id Identifier of a private chat with the user who created the business connection. 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.
* @param int $date Date the connection was established in Unix time
* @param bool $can_reply True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours
* @param bool $is_enabled True, if the connection is active
* @param bool $is_enabled <em>True</em>, if the connection is active
* @param BusinessBotRights $rights <em>Optional</em>. Rights of the business bot
*/
public static function make(
string $id,
User $user,
int $user_chat_id,
int $date,
bool $can_reply,
bool $is_enabled,
?BusinessBotRights $rights = null,
): static {
return new static([
'id' => $id,
'user' => $user,
'user_chat_id' => $user_chat_id,
'date' => $date,
'can_reply' => $can_reply,
'is_enabled' => $is_enabled,
'rights' => $rights,
]);
}
}
6 changes: 6 additions & 0 deletions src/Telegram/Chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class Chat extends Type
/** <em>Optional</em>. <em>True</em>, if the supergroup chat is a forum (has <a href="https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups">topics</a> enabled) */
public ?bool $is_forum = null;

/** <em>Optional</em>. <em>True</em>, if the chat is the direct messages chat of a channel */
public ?bool $is_direct_messages = null;

/**
* @param int $id 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.
* @param string $type Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
Expand All @@ -42,6 +45,7 @@ class Chat extends Type
* @param string $first_name <em>Optional</em>. First name of the other party in a private chat
* @param string $last_name <em>Optional</em>. Last name of the other party in a private chat
* @param bool $is_forum <em>Optional</em>. <em>True</em>, if the supergroup chat is a forum (has <a href="https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups">topics</a> enabled)
* @param bool $is_direct_messages <em>Optional</em>. <em>True</em>, if the chat is the direct messages chat of a channel
*/
public static function make(
int $id,
Expand All @@ -51,6 +55,7 @@ public static function make(
?string $first_name = null,
?string $last_name = null,
?bool $is_forum = null,
?bool $is_direct_messages = null,
): static {
return new static([
'id' => $id,
Expand All @@ -60,6 +65,7 @@ public static function make(
'first_name' => $first_name,
'last_name' => $last_name,
'is_forum' => $is_forum,
'is_direct_messages' => $is_direct_messages,
]);
}
}
Loading