mtproto 0.0.21 → 0.0.22

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b7ded80a63fcfa91991547984a7ffd73198a66216b920106accd235958fde49
4
- data.tar.gz: ec61fe873b71bac923edf826c93a2c46c57ef4b602e92e17a2fc9891aa9ad052
3
+ metadata.gz: 3d821c481442840e9ff4efd6484f531d5d51be2523ebf23c4e12f6ae1a7d397d
4
+ data.tar.gz: 7c1131dfcfcafcef6e0310859d6af1f0d85ae829126288ff3084992ceafa95bf
5
5
  SHA512:
6
- metadata.gz: cd4efbd5e89da27a91baa98abcc8b6dbffc113b3598ea954c2a20daa31510e5b9ad830cfd1c279ed04fca04a4550baf1c657d286fffd12d1ca452f86f27af473
7
- data.tar.gz: 8ad12d3ff4820cbc0da0b3ccd00b81d4fc30e47c2412c88cd86c8fa15997026d2323255682410e2aa25f02bc4c34d0845aebee1f949d7cbc5fcbddc182e11ae9
6
+ metadata.gz: f8fe999e48d98c6bbb5dc6335c4bc075a9a883b130cea978c81a660145f95aa3a70d6e9a4dbe9cf546a99d1cf8306e24dcf242d633a32f9d21667cd1d14f4dbd
7
+ data.tar.gz: a81fee5603238bfb9d0ff7798ffcc11f45f527b4043b32737678c58336c5637e02fe53ab3e07004b5d5e1a8054d1e406196fe7bf24d59d849401b127edca63ba
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../tl/objects/set_typing'
4
+ require_relative '../../tl/objects/send_message_action'
5
+ require_relative '../../tl/objects/raw_response'
6
+
7
+ module MTProto
8
+ class Client
9
+ class API
10
+ # messages.setTyping — show a chat action in `peer`. `action` is a
11
+ # SendMessageAction type symbol (default :typing) or a prebuilt object (pass
12
+ # an object to carry upload progress). `top_msg_id` targets a forum topic /
13
+ # thread. Returns the raw Bool reply, normally ignored.
14
+ def set_typing(peer:, action: :typing, top_msg_id: nil)
15
+ action = TL::SendMessageAction.new(action) unless action.is_a?(TL::SendMessageAction)
16
+ rpc_call(
17
+ TL::SetTyping.new(peer: peer, action: action, top_msg_id: top_msg_id),
18
+ TL::RawResponse
19
+ ).body
20
+ end
21
+ end
22
+ end
23
+ end
@@ -16,6 +16,7 @@ require_relative 'api/get_updates_difference'
16
16
  require_relative 'api/get_channel_difference'
17
17
  require_relative 'api/get_bot_callback_answer'
18
18
  require_relative 'api/send_message'
19
+ require_relative 'api/set_typing'
19
20
  require_relative 'api/get_contacts'
20
21
 
21
22
  module MTProto
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MTProto
4
- VERSION = '0.0.21'
4
+ VERSION = '0.0.22'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mtproto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Levenkov
@@ -79,6 +79,7 @@ files:
79
79
  - lib/mtproto/client/api/import_login_token.rb
80
80
  - lib/mtproto/client/api/send_code.rb
81
81
  - lib/mtproto/client/api/send_message.rb
82
+ - lib/mtproto/client/api/set_typing.rb
82
83
  - lib/mtproto/client/api/sign_in.rb
83
84
  - lib/mtproto/client/rpc.rb
84
85
  - lib/mtproto/client/rpc/response.rb