gruubY 0.2.1 → 0.2.3
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/LICENSE +21 -21
- data/README.md +11 -6
- data/Rakefile +51 -51
- data/config/config.rb +1 -1
- data/example/bot.rb +122 -2
- data/example/generate_user_session.rb +81 -81
- data/example/tdlib.rb +77 -77
- data/example/userbot.rb +133 -133
- data/lib/gruubY/api.rb +540 -363
- data/lib/gruubY/async.rb +13 -13
- data/lib/gruubY/bot.rb +104 -90
- data/lib/gruubY/bound.rb +14 -14
- data/lib/gruubY/client.rb +310 -296
- data/lib/gruubY/context.rb +296 -242
- data/lib/gruubY/dispatcher.rb +60 -60
- data/lib/gruubY/enums.rb +57 -62
- data/lib/gruubY/exception.rb +5 -5
- data/lib/gruubY/file_stream.rb +17 -17
- data/lib/gruubY/filters.rb +292 -292
- data/lib/gruubY/group_manager.rb +213 -213
- data/lib/gruubY/handlers.rb +225 -170
- data/lib/gruubY/keyboard.rb +49 -49
- data/lib/gruubY/media.rb +38 -38
- data/lib/gruubY/middleware.rb +18 -18
- data/lib/gruubY/plugin.rb +27 -14
- data/lib/gruubY/raw.rb +25 -25
- data/lib/gruubY/retry.rb +14 -14
- data/lib/gruubY/server.rb +18 -18
- data/lib/gruubY/session.rb +30 -30
- data/lib/gruubY/tdlib/client.rb +565 -565
- data/lib/gruubY/tdlib/client_manager.rb +37 -37
- data/lib/gruubY/tdlib/decorators.rb +17 -17
- data/lib/gruubY/tdlib/errors.rb +6 -6
- data/lib/gruubY/tdlib/group_manager.rb +58 -58
- data/lib/gruubY/tdlib/native.rb +72 -72
- data/lib/gruubY/tdlib/schema_builder.rb +237 -237
- data/lib/gruubY/tdlib/tdjson.rb +49 -49
- data/lib/gruubY/tdlib/user_session.rb +69 -69
- data/lib/gruubY/types/base_object.rb +72 -72
- data/lib/gruubY/types/bound_entities.rb +289 -245
- data/lib/gruubY/types/chat.rb +93 -93
- data/lib/gruubY/types/chat_info.rb +32 -31
- data/lib/gruubY/types/extra.rb +289 -251
- data/lib/gruubY/types/message.rb +301 -295
- data/lib/gruubY/types/message_entity.rb +14 -14
- data/lib/gruubY/types/registry.rb +86 -67
- data/lib/gruubY/types/user.rb +47 -31
- data/lib/gruubY/webapp.rb +22 -22
- data/lib/gruubY.rb +39 -41
- data/plugins/logger.rb +7 -7
- metadata +3 -9
- data/example/ntgcalls.rb +0 -80
- data/lib/gruubY/ntgcalls/native.rb +0 -100
- data/lib/gruubY/ntgcalls.rb +0 -478
- data/lib/gruubY/raw_types.rb +0 -57
- data/plugins/media_tools.rb +0 -13
|
@@ -1,245 +1,289 @@
|
|
|
1
|
-
require_relative "base_object"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}.
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
call_api("
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
def
|
|
177
|
-
call_raw_api("
|
|
178
|
-
end
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
def
|
|
185
|
-
call_raw_api("
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
def
|
|
193
|
-
call_raw_api("
|
|
194
|
-
end
|
|
195
|
-
|
|
196
|
-
def
|
|
197
|
-
call_raw_api("
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
def
|
|
201
|
-
call_raw_api("
|
|
202
|
-
end
|
|
203
|
-
|
|
204
|
-
def
|
|
205
|
-
call_raw_api("
|
|
206
|
-
end
|
|
207
|
-
|
|
208
|
-
def
|
|
209
|
-
call_raw_api("
|
|
210
|
-
end
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
def
|
|
217
|
-
call_raw_api("
|
|
218
|
-
end
|
|
219
|
-
|
|
220
|
-
def
|
|
221
|
-
call_raw_api("
|
|
222
|
-
end
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
def
|
|
229
|
-
call_raw_api("
|
|
230
|
-
end
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
def
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
1
|
+
require_relative "base_object"
|
|
2
|
+
require_relative "extra"
|
|
3
|
+
|
|
4
|
+
module GrubY
|
|
5
|
+
class Update < BaseObject
|
|
6
|
+
fields :update_id, :message, :edited_message, :channel_post,
|
|
7
|
+
:edited_channel_post, :business_connection, :business_message,
|
|
8
|
+
:edited_business_message, :deleted_business_messages,
|
|
9
|
+
:deleted_messages, :guest_message, :message_reaction, :message_reaction_count,
|
|
10
|
+
:inline_query, :chosen_inline_result, :callback_query,
|
|
11
|
+
:shipping_query, :pre_checkout_query, :purchased_paid_media,
|
|
12
|
+
:poll, :poll_answer, :chat_member, :my_chat_member,
|
|
13
|
+
:chat_join_request, :chat_boost, :removed_chat_boost,
|
|
14
|
+
:widget_query, :shared_widget_query, :bot_subscription_updated,
|
|
15
|
+
:message_generation_stopped, :community_chat_joined,
|
|
16
|
+
:managed_bot_updated, :managed_bot, :subscription,
|
|
17
|
+
:stopped_message_generation
|
|
18
|
+
|
|
19
|
+
def initialize(data, api: nil, client: nil)
|
|
20
|
+
super(data, api: api, client: client)
|
|
21
|
+
@message = Message.new(@message, api: api, client: client) if @message.is_a?(Hash)
|
|
22
|
+
@edited_message = Message.new(@edited_message, api: api, client: client) if @edited_message.is_a?(Hash)
|
|
23
|
+
@channel_post = Message.new(@channel_post, api: api, client: client) if @channel_post.is_a?(Hash)
|
|
24
|
+
@edited_channel_post = Message.new(@edited_channel_post, api: api, client: client) if @edited_channel_post.is_a?(Hash)
|
|
25
|
+
@business_message = Message.new(@business_message, api: api, client: client) if @business_message.is_a?(Hash)
|
|
26
|
+
@edited_business_message = Message.new(@edited_business_message, api: api, client: client) if @edited_business_message.is_a?(Hash)
|
|
27
|
+
@guest_message = Message.new(@guest_message, api: api, client: client) if @guest_message.is_a?(Hash)
|
|
28
|
+
@callback_query = CallbackQuery.new(@callback_query, api: api, client: client) if @callback_query.is_a?(Hash)
|
|
29
|
+
@inline_query = InlineQuery.new(@inline_query, api: api, client: client) if @inline_query.is_a?(Hash)
|
|
30
|
+
@poll_answer = PollAnswer.new(@poll_answer, api: api, client: client) if @poll_answer.is_a?(Hash)
|
|
31
|
+
@widget_query = wrap_update_type("WidgetQuery", @widget_query, api, client)
|
|
32
|
+
@shared_widget_query = wrap_update_type("SharedWidgetQuery", @shared_widget_query, api, client)
|
|
33
|
+
@bot_subscription_updated = wrap_update_type("BotSubscriptionUpdated", @bot_subscription_updated, api, client)
|
|
34
|
+
@message_generation_stopped = wrap_update_type("MessageGenerationStopped", @message_generation_stopped, api, client)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
private
|
|
38
|
+
|
|
39
|
+
def wrap_update_type(type_name, data, api, client)
|
|
40
|
+
return data unless data.is_a?(Hash)
|
|
41
|
+
return data unless GrubY.const_defined?(type_name)
|
|
42
|
+
|
|
43
|
+
klass = GrubY.const_get(type_name)
|
|
44
|
+
klass.new(data, api: api, client: client)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
class CallbackQuery < BaseObject
|
|
49
|
+
fields :id, :from, :message, :inline_message_id, :chat_instance, :data, :game_short_name
|
|
50
|
+
|
|
51
|
+
def answer(text = nil, show_alert: false, **opts)
|
|
52
|
+
call_api("answerCallbackQuery", { callback_query_id: id, text: text, show_alert: show_alert }.merge(opts))
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def edit_message_text(text, **opts)
|
|
56
|
+
edit_payload("editMessageText", { text: text }.merge(opts))
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def edit_message_caption(caption, **opts)
|
|
60
|
+
edit_payload("editMessageCaption", { caption: caption }.merge(opts))
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def edit_message_media(media, **opts)
|
|
64
|
+
edit_payload("editMessageMedia", { media: media }.merge(opts))
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def edit_message_reply_markup(reply_markup = nil, **opts)
|
|
68
|
+
edit_payload("editMessageReplyMarkup", { reply_markup: reply_markup }.merge(opts))
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
private
|
|
72
|
+
|
|
73
|
+
def edit_payload(method, payload)
|
|
74
|
+
if inline_message_id.to_s.empty?
|
|
75
|
+
msg = message || {}
|
|
76
|
+
call_api(method, payload.merge(chat_id: msg.dig("chat", "id"), message_id: msg["message_id"]))
|
|
77
|
+
else
|
|
78
|
+
call_api(method, payload.merge(inline_message_id: inline_message_id))
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
class InlineQuery < BaseObject
|
|
84
|
+
fields :id, :from, :query, :offset, :chat_type, :location
|
|
85
|
+
|
|
86
|
+
def answer(results, **opts)
|
|
87
|
+
call_api("answerInlineQuery", { inline_query_id: id, results: results }.merge(opts))
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
class PreCheckoutQuery < BaseObject
|
|
92
|
+
fields :id, :from, :currency, :total_amount, :invoice_payload, :shipping_option_id, :order_info
|
|
93
|
+
|
|
94
|
+
def answer(ok:, error_message: nil)
|
|
95
|
+
call_api("answerPreCheckoutQuery", { pre_checkout_query_id: id, ok: ok, error_message: error_message }.compact)
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
class ShippingQuery < BaseObject
|
|
100
|
+
fields :id, :from, :invoice_payload, :shipping_address
|
|
101
|
+
|
|
102
|
+
def answer(ok:, shipping_options: nil, error_message: nil)
|
|
103
|
+
call_api("answerShippingQuery", {
|
|
104
|
+
shipping_query_id: id,
|
|
105
|
+
ok: ok,
|
|
106
|
+
shipping_options: shipping_options,
|
|
107
|
+
error_message: error_message
|
|
108
|
+
}.compact)
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
class ChatJoinRequest < BaseObject
|
|
113
|
+
fields :chat, :from, :user_chat_id, :date, :bio, :invite_link
|
|
114
|
+
|
|
115
|
+
def approve
|
|
116
|
+
call_api("approveChatJoinRequest", { chat_id: chat_id!, user_id: user_id! })
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def decline
|
|
120
|
+
call_api("declineChatJoinRequest", { chat_id: chat_id!, user_id: user_id! })
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
private
|
|
124
|
+
|
|
125
|
+
def chat_id!
|
|
126
|
+
chat.is_a?(Hash) ? chat["id"] : chat&.id
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
def user_id!
|
|
130
|
+
from.is_a?(Hash) ? from["id"] : from&.id
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
class Story < BaseObject
|
|
135
|
+
fields :id, :chat, :date
|
|
136
|
+
|
|
137
|
+
def reply_text(text, **opts)
|
|
138
|
+
chat_id = chat.is_a?(Hash) ? chat["id"] : chat&.id
|
|
139
|
+
call_api("sendMessage", { chat_id: chat_id, text: text.to_s }.merge(opts))
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
alias reply reply_text
|
|
143
|
+
alias answer reply_text
|
|
144
|
+
|
|
145
|
+
STORY_SENDERS = {
|
|
146
|
+
animation: "sendAnimation",
|
|
147
|
+
audio: "sendAudio",
|
|
148
|
+
cached_media: "sendDocument",
|
|
149
|
+
media_group: "sendMediaGroup",
|
|
150
|
+
photo: "sendPhoto",
|
|
151
|
+
sticker: "sendSticker",
|
|
152
|
+
video: "sendVideo",
|
|
153
|
+
video_note: "sendVideoNote",
|
|
154
|
+
voice: "sendVoice"
|
|
155
|
+
}.freeze
|
|
156
|
+
|
|
157
|
+
STORY_SENDERS.each do |name, method_name|
|
|
158
|
+
define_method("reply_#{name}") do |payload = nil, **opts|
|
|
159
|
+
cid = chat.is_a?(Hash) ? chat["id"] : chat&.id
|
|
160
|
+
params = { chat_id: cid }.merge(opts)
|
|
161
|
+
params = if name == :media_group
|
|
162
|
+
params.merge(media: payload)
|
|
163
|
+
elsif name == :cached_media
|
|
164
|
+
params.merge(document: payload)
|
|
165
|
+
else
|
|
166
|
+
params.merge(name => payload)
|
|
167
|
+
end
|
|
168
|
+
call_api(method_name, params)
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
define_method("answer_#{name}") do |payload = nil, **opts|
|
|
172
|
+
public_send("reply_#{name}", payload, **opts)
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
def delete
|
|
177
|
+
call_raw_api("deleteStories", { story_ids: [id] })
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
def edit_media(media, **opts)
|
|
181
|
+
call_raw_api("editStoryMedia", { story_id: id, media: media }.merge(opts))
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
def edit_caption(caption, **opts)
|
|
185
|
+
call_raw_api("editStoryCaption", { story_id: id, caption: caption.to_s }.merge(opts))
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
def edit_privacy(privacy, **opts)
|
|
189
|
+
call_raw_api("editStoryPrivacy", { story_id: id, privacy: privacy }.merge(opts))
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
def react(reaction)
|
|
193
|
+
call_raw_api("setStoryReaction", { story_id: id, reaction: reaction })
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
def forward(chat_id:)
|
|
197
|
+
call_raw_api("forwardStory", { story_id: id, chat_id: chat_id })
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
def download(file_name = "story.dat")
|
|
201
|
+
call_raw_api("downloadFile", { story_id: id, file_name: file_name })
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
def read
|
|
205
|
+
call_raw_api("readChatStories", { story_id: id })
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
def view
|
|
209
|
+
call_raw_api("viewStories", { story_ids: [id] })
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
class Folder < BaseObject
|
|
214
|
+
fields :id, :name
|
|
215
|
+
|
|
216
|
+
def delete
|
|
217
|
+
call_raw_api("deleteFolder", { folder_id: id })
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
def edit(**opts)
|
|
221
|
+
call_raw_api("editFolder", { folder_id: id }.merge(opts))
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
class ActiveSession < BaseObject
|
|
226
|
+
fields :hash
|
|
227
|
+
|
|
228
|
+
def reset
|
|
229
|
+
call_raw_api("resetSession", { session_hash: self["hash"] || hash })
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
class Gift < BaseObject
|
|
234
|
+
fields :id, :owned_gift_id
|
|
235
|
+
|
|
236
|
+
def show
|
|
237
|
+
call_raw_api("showGift", gift_payload)
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
def hide
|
|
241
|
+
call_raw_api("hideGift", gift_payload)
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
def convert
|
|
245
|
+
call_raw_api("convertGiftToStars", gift_payload)
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
def upgrade(**opts)
|
|
249
|
+
call_raw_api("upgradeGift", gift_payload.merge(opts))
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
def transfer(user_id:, **opts)
|
|
253
|
+
call_raw_api("transferGift", gift_payload.merge(user_id: user_id).merge(opts))
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
def wear
|
|
257
|
+
call_raw_api("setProfileGift", gift_payload)
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
def buy(**opts)
|
|
261
|
+
call_raw_api("sendGift", gift_payload.merge(opts))
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
def send(user_id:, **opts)
|
|
265
|
+
call_raw_api("sendGift", gift_payload.merge(user_id: user_id).merge(opts))
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
def get_auction_state
|
|
269
|
+
call_raw_api("getGiftAuctionState", gift_payload)
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
def send_purchase_offer(**opts)
|
|
273
|
+
call_raw_api("sendGiftPurchaseOffer", gift_payload.merge(opts))
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
private
|
|
277
|
+
|
|
278
|
+
def gift_payload
|
|
279
|
+
{ gift_id: self["id"] || id, owned_gift_id: self["owned_gift_id"] || owned_gift_id }.compact
|
|
280
|
+
end
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
class Animation < BaseObject
|
|
284
|
+
def add_to_gifs
|
|
285
|
+
file_id = self["file_id"] || dig("file_id")
|
|
286
|
+
call_raw_api("addToGifs", { file_id: file_id })
|
|
287
|
+
end
|
|
288
|
+
end
|
|
289
|
+
end
|