mtproto 0.0.31 → 0.0.32
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/lib/mtproto/updates/event.rb +2 -1
- data/lib/mtproto/updates/event_builder.rb +12 -0
- data/lib/mtproto/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6f20076eea4c2e79508740e13b6f8405437f47ce5ea04f7bffcb55eef0134026
|
|
4
|
+
data.tar.gz: 3e0ad205973f1f54e8ba60b1b97c4cac1c4a67ea5e59d2b7c797950f943953e0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 815dbe344577826f6ef0e6d4fac25c0a56eb58f8372f5612c3c77c8f71b9b2684624f3152b3ba4c7f62046dcb239b1bff6ee95b0af98ab249f79a30928abb6cb
|
|
7
|
+
data.tar.gz: daaf36af66d6cff257881b8ebb3b19ab6c7b6c4bdaa8d7b9ef9f277a7da53539525039380714555948f80112fd46815985c324cbbd6c3075bef8738cf1ef8296
|
|
@@ -12,6 +12,7 @@ module MTProto
|
|
|
12
12
|
# :delete deleted_ids
|
|
13
13
|
# :callback query_id, user_id, data, msg_id
|
|
14
14
|
# :guest_query query_id, message, qts
|
|
15
|
+
# :managed_bot user_id, bot_id
|
|
15
16
|
# `pts`/`pts_count`/`channel` drive ordering and gap detection; they are nil for
|
|
16
17
|
# updates outside the pts sequence (e.g. getDifference's common new_messages,
|
|
17
18
|
# which the protocol delivers without a per-message pts). `users`/`chats` are the
|
|
@@ -21,7 +22,7 @@ module MTProto
|
|
|
21
22
|
:kind, :channel, :pts, :pts_count,
|
|
22
23
|
:peer_type, :peer_id, :msg_id,
|
|
23
24
|
:message, :joined_user_id, :left_user_id, :deleted_ids, :reactors,
|
|
24
|
-
:query_id, :user_id, :data, :qts,
|
|
25
|
+
:query_id, :user_id, :bot_id, :data, :qts,
|
|
25
26
|
:users, :chats,
|
|
26
27
|
keyword_init: true
|
|
27
28
|
)
|
|
@@ -25,6 +25,7 @@ module MTProto
|
|
|
25
25
|
UPDATE_BOT_CALLBACK_QUERY = 0xb9cfc48d
|
|
26
26
|
UPDATE_CHANNEL_PARTICIPANT = 0x985d3abb
|
|
27
27
|
UPDATE_BOT_GUEST_CHAT_QUERY = 0xcdd4093d
|
|
28
|
+
UPDATE_MANAGED_BOT = 0x4880ed9a
|
|
28
29
|
|
|
29
30
|
MESSAGE_SERVICE = 0x7a800e0a
|
|
30
31
|
ACTION_CHAT_ADD_USER = 0x15cefd00
|
|
@@ -61,9 +62,20 @@ module MTProto
|
|
|
61
62
|
participant_event(data, offset)
|
|
62
63
|
when UPDATE_BOT_GUEST_CHAT_QUERY
|
|
63
64
|
guest_query_event(data, offset)
|
|
65
|
+
when UPDATE_MANAGED_BOT
|
|
66
|
+
managed_bot_event(data, offset)
|
|
64
67
|
end
|
|
65
68
|
end
|
|
66
69
|
|
|
70
|
+
# updateManagedBot#4880ed9a user_id:long bot_id:long — a bot the user just minted
|
|
71
|
+
# through this bot acting as its manager. Carries the owner (user_id) and the new
|
|
72
|
+
# bot (bot_id); the bot's access_hash rides in the batch users the parser attaches.
|
|
73
|
+
def managed_bot_event(data, offset)
|
|
74
|
+
Event.new(kind: :managed_bot,
|
|
75
|
+
user_id: data[offset + 4, 8].unpack1('Q<'),
|
|
76
|
+
bot_id: data[offset + 12, 8].unpack1('Q<'))
|
|
77
|
+
end
|
|
78
|
+
|
|
67
79
|
# A Vector<Message> entry (a difference's new_messages) → a :message / :join /
|
|
68
80
|
# :leave Event WITHOUT pts (the protocol omits per-message pts there), or nil.
|
|
69
81
|
# `channel` is the envelope's kind (true for a channelDifference), since the
|
data/lib/mtproto/version.rb
CHANGED