Skip to content

Commit

Permalink
update Types to v6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateodioev committed May 5, 2023
1 parent 8aa2ad8 commit 7bb240d
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 39 deletions.
40 changes: 22 additions & 18 deletions src/Types/ChatMemberUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,41 @@
/**
* This object represents changes in the status of a chat member.
*
* @property Chat $chat Chat the user belongs to
* @property User $from Performer of the action, which resulted in the change
* @property integer $date Date the change was done in Unix time
* @property ChatMember $old_chat_member Previous information about the chat member
* @property ChatMember $new_chat_member New information about the chat member
* @property ChatInviteLink $invite_link Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
* @property Chat $chat Chat the user belongs to
* @property User $from Performer of the action, which resulted in the change
* @property integer $date Date the change was done in Unix time
* @property ChatMember $old_chat_member Previous information about the chat member
* @property ChatMember $new_chat_member New information about the chat member
* @property ?ChatInviteLink $invite_link Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
* @property ?boolean $via_chat_folder_invite_link Optional. True, if the user joined the chat via a chat folder invite link
*
* @method Chat chat()
* @method User from()
* @method integer date()
* @method ChatMember oldChatMember()
* @method ChatMember newChatMember()
* @method ChatInviteLink inviteLink()
* @method Chat chat()
* @method User from()
* @method integer date()
* @method ChatMember oldChatMember()
* @method ChatMember newChatMember()
* @method ?ChatInviteLink inviteLink()
* @method ?boolean viaChatFolderInviteLink()
*
* @method static setChat(Chat $chat)
* @method static setFrom(User $from)
* @method static setDate(integer $date)
* @method static setOldChatMember(ChatMember $oldChatMember)
* @method static setNewChatMember(ChatMember $newChatMember)
* @method static setInviteLink(ChatInviteLink $inviteLink)
* @method static setViaChatFolderInviteLink(boolean $viaChatFolderInviteLink)
*
* @see https://core.telegram.org/bots/api#chatmemberupdated
*/
class ChatMemberUpdated extends baseType
{
protected array $fields = [
'chat' => Chat::class,
'from' => User::class,
'date' => 'integer',
'old_chat_member' => ChatMember::class,
'new_chat_member' => ChatMember::class,
'invite_link' => ChatInviteLink::class,
'chat' => Chat::class,
'from' => User::class,
'date' => 'integer',
'old_chat_member' => ChatMember::class,
'new_chat_member' => ChatMember::class,
'invite_link' => ChatInviteLink::class,
'via_chat_folder_invite_link' => 'boolean'
];
}
44 changes: 24 additions & 20 deletions src/Types/InlineKeyboardButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,36 @@
/**
* This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
*
* @property string $text Label text on the button
* @property ?string $url Optional. HTTP or tg:// URL to be opened when the button is pressed. Links `tg://user?id=<user_id>` can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings.
* @property ?string $callback_data Optional. Data to be sent in a [callback query](https://core.telegram.org/bots/api#callbackquery) to the bot when button is pressed, 1-64 bytes
* @property ?WebAppInfo $web_app Optional. Description of the [Web App](https://core.telegram.org/bots/webapps) that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method [answerWebAppQuery](https://core.telegram.org/bots/api#answerwebappquery). Available only in private chats between a user and the bot
* @property ?LoginUrl $login_url Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the [Telegram Login Widget](https://core.telegram.org/widgets/login).
* @property ?string $switch_inline_query_current_chat Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted
* @property ?string $switch_inline_query Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted.
* @property ?CallbackGame $callback_game Optional. Description of the game that will be launched when the user presses the button.
* @property ?boolean $pay Optional. Specify True, to send a [Pay button](https://core.telegram.org/bots/api#payments).
* @property string $text Label text on the button
* @property ?string $url Optional. HTTP or tg:// URL to be opened when the button is pressed. Links `tg://user?id=<user_id>` can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings.
* @property ?string $callback_data Optional. Data to be sent in a [callback query](https://core.telegram.org/bots/api#callbackquery) to the bot when button is pressed, 1-64 bytes
* @property ?WebAppInfo $web_app Optional. Description of the [Web App](https://core.telegram.org/bots/webapps) that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method [answerWebAppQuery](https://core.telegram.org/bots/api#answerwebappquery). Available only in private chats between a user and the bot
* @property ?LoginUrl $login_url Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the [Telegram Login Widget](https://core.telegram.org/widgets/login).
* @property ?string $switch_inline_query Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted.
* @property ?string $switch_inline_query_current_chat Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted
* @property ?SwitchInlineQueryChosenChat $switch_inline_query_chosen_chat Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field
* @property ?CallbackGame $callback_game Optional. Description of the game that will be launched when the user presses the button.
* @property ?boolean $pay Optional. Specify True, to send a [Pay button](https://core.telegram.org/bots/api#payments).
*
* @method string text()
* @method ?string url()
* @method ?string callbackData()
* @method ?WebAppInfo webApp()
* @method ?LoginUrl loginUrl()
* @method ?string switchInlineQueryCurrentChat()
* @method ?string switchInlineQuery()
* @method ?CallbackGame callbackGame()
* @method ?boolean pay()
* @method string text()
* @method ?string url()
* @method ?string callbackData()
* @method ?WebAppInfo webApp()
* @method ?LoginUrl loginUrl()
* @method ?string switchInlineQuery()
* @method ?string switchInlineQueryCurrentChat()
* @method ?SwitchInlineQueryChosenChat switchInlineQueryChosenChat()
* @method ?CallbackGame callbackGame()
* @method ?boolean pay()
*
* @method static setText(string $text)
* @method static setUrl(string $url)
* @method static setCallbackData(string $callbackData)
* @method static setWebApp(WebAppInfo $webApp)
* @method static setLoginUrl(LoginUrl $loginUrl)
* @method static setSwitchInlineQueryCurrentChat(string $switchInlineQueryCurrentChat)
* @method static setSwitchInlineQuery(string $switchInlineQuery)
* @method static setSwitchInlineQueryCurrentChat(string $switchInlineQueryCurrentChat)
* @method static setSwitchInlineQueryChosenChat(SwitchInlineQueryChosenChat $switchInlineQueryChosenChat)
* @method static setCallbackGame(CallbackGame $callbackGame)
* @method static setPay(boolean $pay)
*
Expand All @@ -45,8 +48,9 @@ class InlineKeyboardButton extends baseType
'callback_data' => 'string',
'web_app' => WebAppInfo::class,
'login_url' => LoginUrl::class,
'switch_inline_query_current_chat' => 'string',
'switch_inline_query' => 'string',
'switch_inline_query_current_chat' => 'string',
'switch_inline_query_chosen_chat' => SwitchInlineQueryChosenChat::class,
'callback_game' => CallbackGame::class,
'pay' => 'boolean',
];
Expand Down
37 changes: 37 additions & 0 deletions src/Types/SwitchInlineQueryChosenChat.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace Mateodioev\Bots\Telegram\Types;

/**
* This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.
*
* @property string $query Optional. The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted
* @property ?boolean $allow_user_chats Optional. True, if private chats with users can be chosen
* @property ?boolean $allow_bot_chats Optional. True, if private chats with bots can be chosen
* @property ?boolean $allow_group_chats Optional. True, if group and supergroup chats can be chosen
* @property ?boolean $allow_channel_chats Optional. True, if channel chats can be chosen
*
* @method string query()
* @method ?boolean allowUserChats()
* @method ?boolean allowBotChats()
* @method ?boolean allowGroupChats()
* @method ?boolean allowChannelChats()
*
* @method static setQuery(string $query)
* @method static setAllowUserChats(boolean $allowUserChats)
* @method static setAllowBotChats(boolean $allowBotChats)
* @method static setAllowGroupChats(boolean $allowGroupChats)
* @method static setAllowChannelChats(boolean $allowChannelChats)
*
* @see https://core.telegram.org/bots/api#switchinlinequerychosenchat
*/
class SwitchInlineQueryChosenChat extends baseType
{
protected array $fields = [
'query' => 'string',
'allow_user_chats' => 'boolean',
'allow_bot_chats' => 'boolean',
'allow_group_chats' => 'boolean',
'allow_channel_chats' => 'boolean',
];
}
11 changes: 10 additions & 1 deletion src/Types/WriteAccessAllowed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@
namespace Mateodioev\Bots\Telegram\Types;

/**
* This object represents a service message about a user allowing a bot added to the attachment menu to write messages. Currently holds no information.
* This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.
*
* @property ?string $web_app_name
*
* @method ?string webAppName()
*
* @method static setWebAppName()
*
* @see https://core.telegram.org/bots/api#writeaccessallowed
*/
class WriteAccessAllowed extends baseType
{
protected array $fields = [
'web_app_name' => 'string'
];
}

0 comments on commit 7bb240d

Please sign in to comment.