Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot api 7.2 support #101

Merged
merged 2 commits into from
Apr 1, 2024
Merged

Conversation

larowka
Copy link
Contributor

@larowka larowka commented Apr 1, 2024

I made revisions to existing methods and objects, as well as added new ones from update 7.2. However, I only tested them with mocks as I didn't have the opportunity to test them on the real API.

I also have a question regarding the chat() and user() methods in the WeStacks\TeleBot\Objects\Update object in relation to the new attributes (Business Connection). Please, feel free to correct me if necessary.

March 31, 2024 - Bot API 7.2

Integration with Business Accounts

  • Added the class BusinessConnection and updates about the connection or disconnection of the bot to a business account, represented by the field business_connection in the class Update.
  • Added updates about new messages in a business account connected to the bot, represented by the field business_message in the class Update.
  • Added updates about message edits in a business account connected to the bot, represented by the field edited_business_message in the class Update.
  • Added updates about message deletion in a business account connected to the bot, represented by the class BusinessMessagesDeleted and the field deleted_business_messages in the class Update.
  • Added the method getBusinessConnection.

Working on Behalf of Business Accounts

  • Added the parameter business_connection_id to the methods sendMessage, sendPhoto, sendVideo, sendAnimation, sendAudio, sendDocument, sendSticker, sendVideoNote, sendVoice, sendLocation, sendVenue, sendContact, sendPoll, sendDice, sendGame, and sendMediaGroup.
  • Added the parameter business_connection_id to the method sendChatAction.
  • Added the field business_connection_id to the class Message.
  • Added the field sender_business_bot to the class Message.

Information about Business Accounts

  • Added the class BusinessIntro and the field business_intro to the class Chat.
  • Added the class BusinessLocation and the field business_location to the class Chat.
  • Added the classes BusinessOpeningHours and BusinessOpeningHoursInterval and the field business_opening_hours to the class Chat.

Mixed-Format Sticker Packs

  • Removed the fields is_animated and is_video from the class StickerSet.
  • Added the field format to the class InputSticker.
  • Removed the parameter sticker_format from the method createNewStickerSet.
  • Added the parameter format to the method setStickerSetThumbnail.
  • Increased the maximum number of stickers in any regular and mask sticker set to 120.
  • Allowed to upload WEBM stickers using SendSticker.

Request Chat Improvements

  • Added the fields request_name, request_username, and request_photo to the class KeyboardButtonRequestUsers.
  • Added the fields request_title, request_username, and request_photo to the class KeyboardButtonRequestChat.
  • Added the class SharedUser and replaced the field user_ids in the class UsersShared with the field users.
  • Added the fields title, username, and photo to the class ChatShared.

Other Changes

  • Added the field is_from_offline to the class Message.
  • Added the field can_connect_to_business to the class User.
  • Added the field personal_chat to the class Chat.
  • Added the method replaceStickerInSet.
  • Added the class Birthdate and the field birthdate to the class Chat.
  • Added the field BiometricManager to the class WebApp.

@@ -18,7 +18,7 @@ class DeleteMessagesMethod extends TelegramMethod

protected array $parameters = [
'chat_id' => 'string',
'message_id' => 'integer[]',
'message_ids' => 'integer[]',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@punyflash punyflash self-requested a review April 1, 2024 06:18
@punyflash punyflash merged commit 4ef5ba1 into westacks:master Apr 1, 2024
1 check failed
@punyflash
Copy link
Member

Regarding the chat() and user() methods, you get all correctly. Huge thanks for your contribution as well as hotfix for message_ids!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants