telegram-bot-ruby 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +6 -9
- data/lib/telegram/bot/api/endpoints.rb +16 -1
- data/lib/telegram/bot/types/bot_access_settings.rb +12 -0
- data/lib/telegram/bot/types/bot_command.rb +1 -0
- data/lib/telegram/bot/types/bot_subscription_updated.rb +13 -0
- data/lib/telegram/bot/types/chat_full_info.rb +2 -0
- data/lib/telegram/bot/types/chat_join_request.rb +1 -0
- data/lib/telegram/bot/types/chat_member_restricted.rb +1 -0
- data/lib/telegram/bot/types/chat_permissions.rb +1 -0
- data/lib/telegram/bot/types/community.rb +12 -0
- data/lib/telegram/bot/types/community_chat_added.rb +11 -0
- data/lib/telegram/bot/types/community_chat_removed.rb +10 -0
- data/lib/telegram/bot/types/external_reply_info.rb +1 -0
- data/lib/telegram/bot/types/inline_query_result_location.rb +1 -1
- data/lib/telegram/bot/types/input_location_message_content.rb +1 -1
- data/lib/telegram/bot/types/input_media.rb +2 -1
- data/lib/telegram/bot/types/input_media_link.rb +12 -0
- data/lib/telegram/bot/types/input_media_live_photo.rb +18 -0
- data/lib/telegram/bot/types/input_media_location.rb +14 -0
- data/lib/telegram/bot/types/input_media_sticker.rb +13 -0
- data/lib/telegram/bot/types/input_media_venue.rb +19 -0
- data/lib/telegram/bot/types/input_media_voice_note.rb +16 -0
- data/lib/telegram/bot/types/input_message_content.rb +1 -0
- data/lib/telegram/bot/types/input_paid_media.rb +1 -0
- data/lib/telegram/bot/types/input_paid_media_live_photo.rb +13 -0
- data/lib/telegram/bot/types/input_poll_media.rb +21 -0
- data/lib/telegram/bot/types/input_poll_option.rb +1 -0
- data/lib/telegram/bot/types/input_poll_option_media.rb +21 -0
- data/lib/telegram/bot/types/input_rich_block.rb +34 -0
- data/lib/telegram/bot/types/input_rich_block_anchor.rb +12 -0
- data/lib/telegram/bot/types/input_rich_block_animation.rb +13 -0
- data/lib/telegram/bot/types/input_rich_block_audio.rb +13 -0
- data/lib/telegram/bot/types/input_rich_block_block_quotation.rb +13 -0
- data/lib/telegram/bot/types/input_rich_block_collage.rb +13 -0
- data/lib/telegram/bot/types/input_rich_block_details.rb +14 -0
- data/lib/telegram/bot/types/input_rich_block_divider.rb +11 -0
- data/lib/telegram/bot/types/input_rich_block_footer.rb +12 -0
- data/lib/telegram/bot/types/input_rich_block_list.rb +12 -0
- data/lib/telegram/bot/types/input_rich_block_list_item.rb +15 -0
- data/lib/telegram/bot/types/input_rich_block_map.rb +16 -0
- data/lib/telegram/bot/types/input_rich_block_mathematical_expression.rb +12 -0
- data/lib/telegram/bot/types/input_rich_block_paragraph.rb +12 -0
- data/lib/telegram/bot/types/input_rich_block_photo.rb +13 -0
- data/lib/telegram/bot/types/input_rich_block_preformatted.rb +13 -0
- data/lib/telegram/bot/types/input_rich_block_pull_quotation.rb +13 -0
- data/lib/telegram/bot/types/input_rich_block_section_heading.rb +13 -0
- data/lib/telegram/bot/types/input_rich_block_slideshow.rb +13 -0
- data/lib/telegram/bot/types/input_rich_block_table.rb +15 -0
- data/lib/telegram/bot/types/input_rich_block_thinking.rb +12 -0
- data/lib/telegram/bot/types/input_rich_block_video.rb +13 -0
- data/lib/telegram/bot/types/input_rich_block_voice_note.rb +13 -0
- data/lib/telegram/bot/types/input_rich_message.rb +16 -0
- data/lib/telegram/bot/types/input_rich_message_content.rb +11 -0
- data/lib/telegram/bot/types/input_rich_message_media.rb +13 -0
- data/lib/telegram/bot/types/link.rb +11 -0
- data/lib/telegram/bot/types/live_photo.rb +18 -0
- data/lib/telegram/bot/types/message.rb +10 -1
- data/lib/telegram/bot/types/paid_media.rb +2 -1
- data/lib/telegram/bot/types/paid_media_live_photo.rb +12 -0
- data/lib/telegram/bot/types/poll.rb +4 -0
- data/lib/telegram/bot/types/poll_media.rb +20 -0
- data/lib/telegram/bot/types/poll_option.rb +1 -0
- data/lib/telegram/bot/types/poll_option_added.rb +1 -1
- data/lib/telegram/bot/types/poll_option_deleted.rb +1 -1
- data/lib/telegram/bot/types/reply_parameters.rb +2 -1
- data/lib/telegram/bot/types/rich_block.rb +34 -0
- data/lib/telegram/bot/types/rich_block_anchor.rb +12 -0
- data/lib/telegram/bot/types/rich_block_animation.rb +14 -0
- data/lib/telegram/bot/types/rich_block_audio.rb +13 -0
- data/lib/telegram/bot/types/rich_block_block_quotation.rb +13 -0
- data/lib/telegram/bot/types/rich_block_caption.rb +12 -0
- data/lib/telegram/bot/types/rich_block_collage.rb +13 -0
- data/lib/telegram/bot/types/rich_block_details.rb +14 -0
- data/lib/telegram/bot/types/rich_block_divider.rb +11 -0
- data/lib/telegram/bot/types/rich_block_footer.rb +12 -0
- data/lib/telegram/bot/types/rich_block_list.rb +12 -0
- data/lib/telegram/bot/types/rich_block_list_item.rb +16 -0
- data/lib/telegram/bot/types/rich_block_map.rb +16 -0
- data/lib/telegram/bot/types/rich_block_mathematical_expression.rb +12 -0
- data/lib/telegram/bot/types/rich_block_paragraph.rb +12 -0
- data/lib/telegram/bot/types/rich_block_photo.rb +14 -0
- data/lib/telegram/bot/types/rich_block_preformatted.rb +13 -0
- data/lib/telegram/bot/types/rich_block_pull_quotation.rb +13 -0
- data/lib/telegram/bot/types/rich_block_section_heading.rb +13 -0
- data/lib/telegram/bot/types/rich_block_slideshow.rb +13 -0
- data/lib/telegram/bot/types/rich_block_table.rb +15 -0
- data/lib/telegram/bot/types/rich_block_table_cell.rb +16 -0
- data/lib/telegram/bot/types/rich_block_thinking.rb +12 -0
- data/lib/telegram/bot/types/rich_block_video.rb +14 -0
- data/lib/telegram/bot/types/rich_block_voice_note.rb +13 -0
- data/lib/telegram/bot/types/rich_message.rb +12 -0
- data/lib/telegram/bot/types/rich_text.rb +38 -0
- data/lib/telegram/bot/types/rich_text_anchor.rb +12 -0
- data/lib/telegram/bot/types/rich_text_anchor_link.rb +13 -0
- data/lib/telegram/bot/types/rich_text_bank_card_number.rb +13 -0
- data/lib/telegram/bot/types/rich_text_bold.rb +12 -0
- data/lib/telegram/bot/types/rich_text_bot_command.rb +13 -0
- data/lib/telegram/bot/types/rich_text_cashtag.rb +13 -0
- data/lib/telegram/bot/types/rich_text_code.rb +12 -0
- data/lib/telegram/bot/types/rich_text_custom_emoji.rb +13 -0
- data/lib/telegram/bot/types/rich_text_date_time.rb +14 -0
- data/lib/telegram/bot/types/rich_text_email_address.rb +13 -0
- data/lib/telegram/bot/types/rich_text_hashtag.rb +13 -0
- data/lib/telegram/bot/types/rich_text_italic.rb +12 -0
- data/lib/telegram/bot/types/rich_text_marked.rb +12 -0
- data/lib/telegram/bot/types/rich_text_mathematical_expression.rb +12 -0
- data/lib/telegram/bot/types/rich_text_mention.rb +13 -0
- data/lib/telegram/bot/types/rich_text_phone_number.rb +13 -0
- data/lib/telegram/bot/types/rich_text_reference.rb +13 -0
- data/lib/telegram/bot/types/rich_text_reference_link.rb +13 -0
- data/lib/telegram/bot/types/rich_text_spoiler.rb +12 -0
- data/lib/telegram/bot/types/rich_text_strikethrough.rb +12 -0
- data/lib/telegram/bot/types/rich_text_subscript.rb +12 -0
- data/lib/telegram/bot/types/rich_text_superscript.rb +12 -0
- data/lib/telegram/bot/types/rich_text_text_mention.rb +13 -0
- data/lib/telegram/bot/types/rich_text_underline.rb +12 -0
- data/lib/telegram/bot/types/rich_text_url.rb +13 -0
- data/lib/telegram/bot/types/sent_guest_message.rb +11 -0
- data/lib/telegram/bot/types/update.rb +2 -0
- data/lib/telegram/bot/types/user.rb +2 -0
- data/lib/telegram/bot/types.rb +6 -0
- data/lib/telegram/bot/version.rb +1 -1
- data/rakelib/builders/type_builder.rb +5 -2
- data/rakelib/builders/type_dependencies.rb +45 -0
- data/rakelib/rebuild.rake +4 -1
- metadata +100 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 305b7281c7f2f3d51656d5556d9435d3b6267ae4f275fc9a04b430cb275eabb2
|
|
4
|
+
data.tar.gz: cc6af3a9f74e56a9eb70d4b32cceeaddffb5a4c20cb0e8577b2abdb3ba5ccfb0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b72f319422e8943a43fb2128e0553a4bf8518c28ed01489724b2a277797cceb60122302d1127aa14f55938f6d063e10226dd3d72e1fade237975e2648925d7a3
|
|
7
|
+
data.tar.gz: 17365086472228247b0e51cfba2d5f3661df32264267c9a2643f7372c39d315255626360dc5cc59341619ded5cf1c6e7528a0e368049b9b8740f9973eb5c8ba0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.8.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- [Bot API 10.0](https://core.telegram.org/bots/api-changelog#may-8-2026) + [Bot API 10.1](https://core.telegram.org/bots/api-changelog#june-11-2026) + [Bot API 10.2](https://core.telegram.org/bots/api-changelog#july-14-2026) [#336](https://github.com/atipugin/telegram-bot-ruby/pull/336)
|
|
8
|
+
|
|
3
9
|
## 2.7.0
|
|
4
10
|
|
|
5
11
|
### Added
|
data/README.md
CHANGED
|
@@ -5,14 +5,13 @@ Ruby wrapper for [Telegram's Bot API](https://core.telegram.org/bots/api).
|
|
|
5
5
|
[](http://badge.fury.io/rb/telegram-bot-ruby)
|
|
6
6
|
[](https://github.com/atipugin/telegram-bot-ruby/actions)
|
|
7
7
|
[](https://codeclimate.com/github/atipugin/telegram-bot-ruby/maintainability)
|
|
8
|
-
[](https://saythanks.io/to/atipugin)
|
|
9
8
|
|
|
10
9
|
## Installation
|
|
11
10
|
|
|
12
11
|
Add following line to your Gemfile:
|
|
13
12
|
|
|
14
13
|
```ruby
|
|
15
|
-
gem 'telegram-bot-ruby', '~> 2.
|
|
14
|
+
gem 'telegram-bot-ruby', '~> 2.7'
|
|
16
15
|
```
|
|
17
16
|
|
|
18
17
|
And then execute:
|
|
@@ -200,11 +199,9 @@ bot.listen do |message|
|
|
|
200
199
|
end
|
|
201
200
|
```
|
|
202
201
|
|
|
203
|
-
Now, with `inline` mode enabled, your `message` object can be an instance of
|
|
204
|
-
[
|
|
205
|
-
|
|
206
|
-
[ChosenInlineResult](https://core.telegram.org/bots/api#choseninlineresult).
|
|
207
|
-
That's why you need to check type of each message and decide how to handle it.
|
|
202
|
+
Now, with `inline` mode enabled, your `message` object can be an instance of any
|
|
203
|
+
[update type](https://core.telegram.org/bots/api#update) supported by the Bot API.
|
|
204
|
+
That's why you need to check the type of each message and decide how to handle it.
|
|
208
205
|
|
|
209
206
|
Using `answer_inline_query` you can send query results to user.
|
|
210
207
|
`results` field must be an array of [query result objects](https://core.telegram.org/bots/api#inlinequeryresult).
|
|
@@ -225,7 +222,7 @@ bot.listen do |message|
|
|
|
225
222
|
case message.text
|
|
226
223
|
when '/photo'
|
|
227
224
|
path_to_photo = File.expand_path('~/Desktop/jennifer.jpg')
|
|
228
|
-
bot.api.send_photo(chat_id: message.chat.id, photo: Faraday::
|
|
225
|
+
bot.api.send_photo(chat_id: message.chat.id, photo: Faraday::Multipart::FilePart.new(path_to_photo, 'image/jpeg'))
|
|
229
226
|
end
|
|
230
227
|
end
|
|
231
228
|
```
|
|
@@ -247,7 +244,7 @@ end
|
|
|
247
244
|
|
|
248
245
|
## Connection adapters
|
|
249
246
|
|
|
250
|
-
|
|
247
|
+
We rely on [faraday](https://github.com/lostisland/faraday) under the hood.
|
|
251
248
|
You can use any of supported adapters (for example, `net/http/persistent`):
|
|
252
249
|
|
|
253
250
|
```ruby
|
|
@@ -17,6 +17,7 @@ module Telegram
|
|
|
17
17
|
'copyMessage' => Types::MessageId,
|
|
18
18
|
'copyMessages' => Types::Array.of(Types::MessageId),
|
|
19
19
|
'sendPhoto' => Types::Message,
|
|
20
|
+
'sendLivePhoto' => Types::Message,
|
|
20
21
|
'sendAudio' => Types::Message,
|
|
21
22
|
'sendDocument' => Types::Message,
|
|
22
23
|
'sendVideo' => Types::Message,
|
|
@@ -55,6 +56,8 @@ module Telegram
|
|
|
55
56
|
'revokeChatInviteLink' => Types::ChatInviteLink,
|
|
56
57
|
'approveChatJoinRequest' => Types::Bool,
|
|
57
58
|
'declineChatJoinRequest' => Types::Bool,
|
|
59
|
+
'answerChatJoinRequestQuery' => Types::Bool,
|
|
60
|
+
'sendChatJoinRequestWebApp' => Types::Bool,
|
|
58
61
|
'setChatPhoto' => Types::Bool,
|
|
59
62
|
'deleteChatPhoto' => Types::Bool,
|
|
60
63
|
'setChatTitle' => Types::Bool,
|
|
@@ -65,8 +68,8 @@ module Telegram
|
|
|
65
68
|
'leaveChat' => Types::Bool,
|
|
66
69
|
'getChat' => Types::ChatFullInfo,
|
|
67
70
|
'getChatAdministrators' => Types::Array.of(Types::ChatMember),
|
|
68
|
-
'getChatMemberCount' => Types::Integer,
|
|
69
71
|
'getChatMember' => Types::ChatMember,
|
|
72
|
+
'getUserPersonalChatMessages' => Types::Array.of(Types::Message),
|
|
70
73
|
'setChatStickerSet' => Types::Bool,
|
|
71
74
|
'deleteChatStickerSet' => Types::Bool,
|
|
72
75
|
'getForumTopicIconStickers' => Types::Array.of(Types::Sticker),
|
|
@@ -83,10 +86,13 @@ module Telegram
|
|
|
83
86
|
'unhideGeneralForumTopic' => Types::Bool,
|
|
84
87
|
'unpinAllGeneralForumTopicMessages' => Types::Bool,
|
|
85
88
|
'answerCallbackQuery' => Types::Bool,
|
|
89
|
+
'answerGuestQuery' => Types::SentGuestMessage,
|
|
86
90
|
'getUserChatBoosts' => Types::UserChatBoosts,
|
|
87
91
|
'getBusinessConnection' => Types::BusinessConnection,
|
|
88
92
|
'getManagedBotToken' => Types::String,
|
|
89
93
|
'replaceManagedBotToken' => Types::String,
|
|
94
|
+
'getManagedBotAccessSettings' => Types::BotAccessSettings,
|
|
95
|
+
'setManagedBotAccessSettings' => Types::Bool,
|
|
90
96
|
'setMyCommands' => Types::Bool,
|
|
91
97
|
'deleteMyCommands' => Types::Bool,
|
|
92
98
|
'getMyCommands' => Types::Array.of(Types::BotCommand),
|
|
@@ -140,10 +146,17 @@ module Telegram
|
|
|
140
146
|
'editMessageChecklist' => Types::Message,
|
|
141
147
|
'editMessageReplyMarkup' => Types::Message | Types::Bool,
|
|
142
148
|
'stopPoll' => Types::Poll,
|
|
149
|
+
'editEphemeralMessageText' => Types::Bool,
|
|
150
|
+
'editEphemeralMessageMedia' => Types::Bool,
|
|
151
|
+
'editEphemeralMessageCaption' => Types::Bool,
|
|
152
|
+
'editEphemeralMessageReplyMarkup' => Types::Bool,
|
|
143
153
|
'approveSuggestedPost' => Types::Bool,
|
|
144
154
|
'declineSuggestedPost' => Types::Bool,
|
|
145
155
|
'deleteMessage' => Types::Bool,
|
|
146
156
|
'deleteMessages' => Types::Bool,
|
|
157
|
+
'deleteEphemeralMessage' => Types::Bool,
|
|
158
|
+
'deleteMessageReaction' => Types::Bool,
|
|
159
|
+
'deleteAllMessageReactions' => Types::Bool,
|
|
147
160
|
'sendSticker' => Types::Message,
|
|
148
161
|
'getStickerSet' => Types::StickerSet,
|
|
149
162
|
'getCustomEmojiStickers' => Types::Array.of(Types::Sticker),
|
|
@@ -160,6 +173,8 @@ module Telegram
|
|
|
160
173
|
'setStickerSetThumbnail' => Types::Bool,
|
|
161
174
|
'setCustomEmojiStickerSetThumbnail' => Types::Bool,
|
|
162
175
|
'deleteStickerSet' => Types::Bool,
|
|
176
|
+
'sendRichMessage' => Types::Message,
|
|
177
|
+
'sendRichMessageDraft' => Types::Bool,
|
|
163
178
|
'answerInlineQuery' => Types::Bool,
|
|
164
179
|
'sendInvoice' => Types::Message,
|
|
165
180
|
'createInvoiceLink' => Types::String,
|
|
@@ -18,6 +18,7 @@ module Telegram
|
|
|
18
18
|
attribute :can_send_polls, Types::Bool
|
|
19
19
|
attribute :can_send_other_messages, Types::Bool
|
|
20
20
|
attribute :can_add_web_page_previews, Types::Bool
|
|
21
|
+
attribute :can_react_to_messages, Types::Bool
|
|
21
22
|
attribute :can_edit_tag, Types::Bool
|
|
22
23
|
attribute :can_change_info, Types::Bool
|
|
23
24
|
attribute :can_invite_users, Types::Bool
|
|
@@ -14,6 +14,7 @@ module Telegram
|
|
|
14
14
|
attribute? :can_send_polls, Types::Bool
|
|
15
15
|
attribute? :can_send_other_messages, Types::Bool
|
|
16
16
|
attribute? :can_add_web_page_previews, Types::Bool
|
|
17
|
+
attribute? :can_react_to_messages, Types::Bool
|
|
17
18
|
attribute? :can_edit_tag, Types::Bool
|
|
18
19
|
attribute? :can_change_info, Types::Bool
|
|
19
20
|
attribute? :can_invite_users, Types::Bool
|
|
@@ -11,6 +11,7 @@ module Telegram
|
|
|
11
11
|
attribute? :animation, Animation
|
|
12
12
|
attribute? :audio, Audio
|
|
13
13
|
attribute? :document, Document
|
|
14
|
+
attribute? :live_photo, LivePhoto
|
|
14
15
|
attribute? :paid_media, PaidMediaInfo
|
|
15
16
|
attribute? :photo, Types::Array.of(PhotoSize)
|
|
16
17
|
attribute? :sticker, Sticker
|
|
@@ -10,7 +10,7 @@ module Telegram
|
|
|
10
10
|
attribute :longitude, Types::Float
|
|
11
11
|
attribute :title, Types::String
|
|
12
12
|
attribute? :horizontal_accuracy, Types::Float
|
|
13
|
-
attribute? :live_period, Types::Integer
|
|
13
|
+
attribute? :live_period, Types::Integer.constrained(min_size: 60, max_size: 86_400)
|
|
14
14
|
attribute? :heading, Types::Integer
|
|
15
15
|
attribute? :proximity_alert_radius, Types::Integer
|
|
16
16
|
attribute? :reply_markup, InlineKeyboardMarkup
|
|
@@ -7,7 +7,7 @@ module Telegram
|
|
|
7
7
|
attribute :latitude, Types::Float
|
|
8
8
|
attribute :longitude, Types::Float
|
|
9
9
|
attribute? :horizontal_accuracy, Types::Float
|
|
10
|
-
attribute? :live_period, Types::Integer
|
|
10
|
+
attribute? :live_period, Types::Integer.constrained(min_size: 60, max_size: 86_400)
|
|
11
11
|
attribute? :heading, Types::Integer
|
|
12
12
|
attribute? :proximity_alert_radius, Types::Integer
|
|
13
13
|
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
class InputMediaLivePhoto < Base
|
|
7
|
+
attribute :type, Types::String.constrained(eql: 'live_photo').default('live_photo')
|
|
8
|
+
attribute :media, Types::String
|
|
9
|
+
attribute :photo, Types::String
|
|
10
|
+
attribute? :caption, Types::String
|
|
11
|
+
attribute? :parse_mode, Types::String
|
|
12
|
+
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
|
13
|
+
attribute? :show_caption_above_media, Types::Bool
|
|
14
|
+
attribute? :has_spoiler, Types::Bool
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
class InputMediaLocation < Base
|
|
7
|
+
attribute :type, Types::String.constrained(eql: 'location').default('location')
|
|
8
|
+
attribute :latitude, Types::Float
|
|
9
|
+
attribute :longitude, Types::Float
|
|
10
|
+
attribute? :horizontal_accuracy, Types::Float
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
class InputMediaSticker < Base
|
|
7
|
+
attribute :type, Types::String.constrained(eql: 'sticker').default('sticker')
|
|
8
|
+
attribute :media, Types::String
|
|
9
|
+
attribute? :emoji, Types::String
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
class InputMediaVenue < Base
|
|
7
|
+
attribute :type, Types::String.constrained(eql: 'venue').default('venue')
|
|
8
|
+
attribute :latitude, Types::Float
|
|
9
|
+
attribute :longitude, Types::Float
|
|
10
|
+
attribute :title, Types::String
|
|
11
|
+
attribute :address, Types::String
|
|
12
|
+
attribute? :foursquare_id, Types::String
|
|
13
|
+
attribute? :foursquare_type, Types::String
|
|
14
|
+
attribute? :google_place_id, Types::String
|
|
15
|
+
attribute? :google_place_type, Types::String
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
class InputMediaVoiceNote < Base
|
|
7
|
+
attribute :type, Types::String.constrained(eql: 'voice_note').default('voice_note')
|
|
8
|
+
attribute :media, Types::String
|
|
9
|
+
attribute? :caption, Types::String
|
|
10
|
+
attribute? :parse_mode, Types::String
|
|
11
|
+
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
|
12
|
+
attribute? :duration, Types::Integer
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
class InputPaidMediaLivePhoto < Base
|
|
7
|
+
attribute :type, Types::String.constrained(eql: 'live_photo').default('live_photo')
|
|
8
|
+
attribute :media, Types::String
|
|
9
|
+
attribute :photo, Types::String
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
## Just for classes consistency
|
|
7
|
+
# rubocop:disable Naming/ConstantName
|
|
8
|
+
InputPollMedia = (
|
|
9
|
+
InputMediaAnimation |
|
|
10
|
+
InputMediaAudio |
|
|
11
|
+
InputMediaDocument |
|
|
12
|
+
InputMediaLivePhoto |
|
|
13
|
+
InputMediaLocation |
|
|
14
|
+
InputMediaPhoto |
|
|
15
|
+
InputMediaVenue |
|
|
16
|
+
InputMediaVideo
|
|
17
|
+
)
|
|
18
|
+
# rubocop:enable Naming/ConstantName
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
## Just for classes consistency
|
|
7
|
+
# rubocop:disable Naming/ConstantName
|
|
8
|
+
InputPollOptionMedia = (
|
|
9
|
+
InputMediaAnimation |
|
|
10
|
+
InputMediaLink |
|
|
11
|
+
InputMediaLivePhoto |
|
|
12
|
+
InputMediaLocation |
|
|
13
|
+
InputMediaPhoto |
|
|
14
|
+
InputMediaSticker |
|
|
15
|
+
InputMediaVenue |
|
|
16
|
+
InputMediaVideo
|
|
17
|
+
)
|
|
18
|
+
# rubocop:enable Naming/ConstantName
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
## Just for classes consistency
|
|
7
|
+
# rubocop:disable Naming/ConstantName
|
|
8
|
+
InputRichBlock = (
|
|
9
|
+
InputRichBlockParagraph |
|
|
10
|
+
InputRichBlockSectionHeading |
|
|
11
|
+
InputRichBlockPreformatted |
|
|
12
|
+
InputRichBlockFooter |
|
|
13
|
+
InputRichBlockDivider |
|
|
14
|
+
InputRichBlockMathematicalExpression |
|
|
15
|
+
InputRichBlockAnchor |
|
|
16
|
+
InputRichBlockList |
|
|
17
|
+
InputRichBlockBlockQuotation |
|
|
18
|
+
InputRichBlockPullQuotation |
|
|
19
|
+
InputRichBlockCollage |
|
|
20
|
+
InputRichBlockSlideshow |
|
|
21
|
+
InputRichBlockTable |
|
|
22
|
+
InputRichBlockDetails |
|
|
23
|
+
InputRichBlockMap |
|
|
24
|
+
InputRichBlockAnimation |
|
|
25
|
+
InputRichBlockAudio |
|
|
26
|
+
InputRichBlockPhoto |
|
|
27
|
+
InputRichBlockVideo |
|
|
28
|
+
InputRichBlockVoiceNote |
|
|
29
|
+
InputRichBlockThinking
|
|
30
|
+
)
|
|
31
|
+
# rubocop:enable Naming/ConstantName
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
class InputRichBlockAnimation < Base
|
|
7
|
+
attribute :type, Types::String.constrained(eql: 'animation').default('animation')
|
|
8
|
+
attribute :animation, InputMediaAnimation
|
|
9
|
+
attribute? :caption, RichBlockCaption
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
class InputRichBlockAudio < Base
|
|
7
|
+
attribute :type, Types::String.constrained(eql: 'audio').default('audio')
|
|
8
|
+
attribute :audio, InputMediaAudio
|
|
9
|
+
attribute? :caption, RichBlockCaption
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
class InputRichBlockBlockQuotation < Base
|
|
7
|
+
attribute :type, Types::String.constrained(eql: 'blockquote').default('blockquote')
|
|
8
|
+
attribute :blocks, Types::Array.of(Types.deferred(:InputRichBlock))
|
|
9
|
+
attribute? :credit, RichText
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
class InputRichBlockCollage < Base
|
|
7
|
+
attribute :type, Types::String.constrained(eql: 'collage').default('collage')
|
|
8
|
+
attribute :blocks, Types::Array.of(Types.deferred(:InputRichBlock))
|
|
9
|
+
attribute? :caption, RichBlockCaption
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
class InputRichBlockDetails < Base
|
|
7
|
+
attribute :type, Types::String.constrained(eql: 'details').default('details')
|
|
8
|
+
attribute :summary, RichText
|
|
9
|
+
attribute :blocks, Types::Array.of(Types.deferred(:InputRichBlock))
|
|
10
|
+
attribute? :is_open, Types::True
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
class InputRichBlockList < Base
|
|
7
|
+
attribute :type, Types::String.constrained(eql: 'list').default('list')
|
|
8
|
+
attribute :items, Types::Array.of(InputRichBlockListItem)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|