Skip to content

Commit

Permalink
Implement Bot API 8.3 (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
atipugin authored Feb 13, 2025
1 parent 53c20f2 commit 5c778e9
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 0 deletions.
39 changes: 39 additions & 0 deletions data/type_attributes.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@
"permissions": {
"type": "ChatPermissions"
},
"can_send_gift": {
"type": "boolean",
"default": true
},
"can_send_paid_media": {
"type": "boolean",
"default": true
Expand Down Expand Up @@ -1023,6 +1027,13 @@
"thumbnail": {
"type": "PhotoSize"
},
"cover": {
"type": "array",
"items": "PhotoSize"
},
"start_timestamp": {
"type": "integer"
},
"file_name": {
"type": "string"
},
Expand Down Expand Up @@ -3016,6 +3027,12 @@
"thumbnail": {
"type": "string"
},
"cover": {
"type": "string"
},
"start_timestamp": {
"type": "integer"
},
"caption": {
"type": "string",
"max_size": 1024
Expand Down Expand Up @@ -3183,6 +3200,12 @@
"thumbnail": {
"type": "string"
},
"cover": {
"type": "string"
},
"start_timestamp": {
"type": "integer"
},
"width": {
"type": "integer"
},
Expand Down Expand Up @@ -4734,6 +4757,7 @@
"TransactionPartner": {
"type": [
"TransactionPartnerUser",
"TransactionPartnerChat",
"TransactionPartnerAffiliateProgram",
"TransactionPartnerFragment",
"TransactionPartnerTelegramAds",
Expand Down Expand Up @@ -4772,6 +4796,21 @@
"type": "Gift"
}
},
"TransactionPartnerChat": {
"type": {
"type": "string",
"required": true,
"required_value": "chat",
"default": "chat"
},
"chat": {
"type": "Chat",
"required": true
},
"gift": {
"type": "Gift"
}
},
"TransactionPartnerAffiliateProgram": {
"type": {
"type": "string",
Expand Down
1 change: 1 addition & 0 deletions lib/telegram/bot/types/chat_full_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class ChatFullInfo < Base
attribute? :invite_link, Types::String
attribute? :pinned_message, Message
attribute? :permissions, ChatPermissions
attribute? :can_send_gift, Types::True
attribute? :can_send_paid_media, Types::True
attribute? :slow_mode_delay, Types::Integer
attribute? :unrestrict_boost_count, Types::Integer
Expand Down
2 changes: 2 additions & 0 deletions lib/telegram/bot/types/input_media_video.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class InputMediaVideo < Base
attribute :type, Types::String.constrained(eql: 'video').default('video')
attribute :media, Types::String
attribute? :thumbnail, Types::String
attribute? :cover, Types::String
attribute? :start_timestamp, Types::Integer
attribute? :caption, Types::String
attribute? :parse_mode, Types::String
attribute? :caption_entities, Types::Array.of(MessageEntity)
Expand Down
2 changes: 2 additions & 0 deletions lib/telegram/bot/types/input_paid_media_video.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class InputPaidMediaVideo < Base
attribute :type, Types::String.constrained(eql: 'video').default('video')
attribute :media, Types::String
attribute? :thumbnail, Types::String
attribute? :cover, Types::String
attribute? :start_timestamp, Types::Integer
attribute? :width, Types::Integer
attribute? :height, Types::Integer
attribute? :duration, Types::Integer
Expand Down
1 change: 1 addition & 0 deletions lib/telegram/bot/types/transaction_partner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module Types
# rubocop:disable Naming/ConstantName
TransactionPartner = (
TransactionPartnerUser |
TransactionPartnerChat |
TransactionPartnerAffiliateProgram |
TransactionPartnerFragment |
TransactionPartnerTelegramAds |
Expand Down
13 changes: 13 additions & 0 deletions lib/telegram/bot/types/transaction_partner_chat.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Telegram
module Bot
module Types
class TransactionPartnerChat < Base
attribute :type, Types::String.constrained(eql: 'chat').default('chat')
attribute :chat, Chat
attribute? :gift, Gift
end
end
end
end
2 changes: 2 additions & 0 deletions lib/telegram/bot/types/video.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class Video < Base
attribute :height, Types::Integer
attribute :duration, Types::Integer
attribute? :thumbnail, PhotoSize
attribute? :cover, Types::Array.of(PhotoSize)
attribute? :start_timestamp, Types::Integer
attribute? :file_name, Types::String
attribute? :mime_type, Types::String
attribute? :file_size, Types::Integer
Expand Down

0 comments on commit 5c778e9

Please sign in to comment.