icqbot 0.1.2 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad954e93e3dfea76ebf298daf4ac1eaccdbbd09cbf455961d7e059682c410e6b
4
- data.tar.gz: 57c3ff74c3367bd8de40e73c24204155061e69278c0ae90ac3a44776e112e170
3
+ metadata.gz: 743e5831359d79b519c7c2919eef74941af16c2d6e5a2724ee950842617a6c77
4
+ data.tar.gz: 664454f4c6e2e82696f0a9be6a191476a9cae82cf585b3b863c3144ace066649
5
5
  SHA512:
6
- metadata.gz: a033630de3734747ed6f07ab28c579bd2cc113afb8d64c9a73803f40fef5285c88b3df0e8d1906ffbb4c1def41d7d92df1c1b8e0a2e716546d25bf007b29e846
7
- data.tar.gz: 344731d2f7c803bcdb2d5f486cfb2f3ac7c5dcfb348af9ac9ecc713c1ebf17395f43973bd20040cf483ee11fc30e902d28effcfdfe8d1207a4e119040ce2a502
6
+ metadata.gz: 0e0a7cb347ca9dbe5c8d735ddf3deea5c08b3f94c710c09b2a7808ae6ccb7f70afaf373ea44270b15f677624026fd954b870bb6ed0c14e8b59ab645143012fd2
7
+ data.tar.gz: 7583cf6516fc863fe0de6744ee95d0ed676748fbf63b9c3bdbf7945b8e916cfc66e62c2ab79ad39b63f6d067572d5bba6d197fdee85ed16c18db2f48234bbbd9
data/doc/bot.md CHANGED
@@ -69,4 +69,28 @@ def get_blocked_users chat_id # -> [Hash]
69
69
  ```ruby
70
70
  def get_admins chat_id # -> [Hash]
71
71
  ```
72
- 1. `chat_id` - ID чата, откуда надо получить список aдминов.
72
+ 1. `chat_id` - ID чата, откуда надо получить список aдминов.
73
+
74
+ # Chat administration
75
+ Для работы этих методов бот должен иметь права администрации.
76
+
77
+ ## Установка названия чата
78
+ ```ruby
79
+ def set_title chat_id, title # -> Hash
80
+ ```
81
+ 1. `chat_id` - ID чата.
82
+ 2. `title` - новое название чата.
83
+
84
+ ## Установка описания чата
85
+ ```ruby
86
+ def set_about chat_id, about # -> Hash
87
+ ```
88
+ 1. `chat_id` - ID чата.
89
+ 2. `about` - новое описание чата.
90
+
91
+ ## Установка правил чата
92
+ ```ruby
93
+ def set_rules chat_id, rules # -> Hash
94
+ ```
95
+ 1. `chat_id` - ID чата.
96
+ 2. `rules` - правила чата.
@@ -6,5 +6,5 @@ require_relative './icqbot/user.rb'
6
6
  require_relative './icqbot/message.rb'
7
7
 
8
8
  module ICQ
9
- VERSION = '0.1.2'
9
+ VERSION = '0.1.3'
10
10
  end
@@ -9,6 +9,10 @@ require_relative './functional/delete_msg.rb'
9
9
  require_relative './functional/chats/get_info.rb'
10
10
  require_relative './functional/chats/get_admins.rb'
11
11
  require_relative './functional/chats/get_members.rb'
12
+ require_relative './functional/chats/administration/set_title.rb'
13
+ require_relative './functional/chats/administration/set_about.rb'
14
+ require_relative './functional/chats/administration/set_rules.rb'
15
+
12
16
 
13
17
  module ICQ
14
18
 
@@ -0,0 +1,14 @@
1
+ require_relative '../../../bot.rb'
2
+
3
+ module ICQ
4
+
5
+ class Bot
6
+ def set_about chat_id, about
7
+ params = base_req chat_id
8
+ params['about'] = about
9
+ JSON::load Requests.get(
10
+ URLS_API::SET_ABOUT, params: params).body
11
+ end
12
+ end
13
+
14
+ end
@@ -0,0 +1,14 @@
1
+ require_relative '../../../bot.rb'
2
+
3
+ module ICQ
4
+
5
+ class Bot
6
+ def set_rules chat_id, rules
7
+ params = base_req chat_id
8
+ params['rules'] = rules
9
+ JSON::load Requests.get(
10
+ URLS_API::SET_RULES, params: params).body
11
+ end
12
+ end
13
+
14
+ end
@@ -0,0 +1,18 @@
1
+ require_relative '../../../bot.rb'
2
+
3
+ module ICQ
4
+
5
+ class Bot
6
+ def set_title chat_id, title
7
+ params = base_req chat_id
8
+ params['title'] = title
9
+ JSON::load Requests.get(
10
+ URLS_API::SET_TITLE, params: params).body
11
+ end
12
+
13
+ def title= o
14
+ set_title *o
15
+ end
16
+ end
17
+
18
+ end
@@ -8,4 +8,7 @@ module URLS_API
8
8
  GET_ADMINS = 'https://api.icq.net/bot/v1/chats/getAdmins'
9
9
  GET_MEMBRS = 'https://api.icq.net/bot/v1/chats/getMembers'
10
10
  GET_BLOCKED_USERS = 'https://api.icq.net/bot/v1/chats/getBlockedUsers'
11
+ SET_TITLE = 'https://api.icq.net/bot/v1/chats/setTitle'
12
+ SET_ABOUT = 'https://api.icq.net/bot/v1/chats/setAbout'
13
+ SET_RULES = 'https://api.icq.net/bot/v1/chats/setRules'
11
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icqbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - sheyber
@@ -53,6 +53,9 @@ files:
53
53
  - lib/icqbot.rb
54
54
  - lib/icqbot/bot.rb
55
55
  - lib/icqbot/event.rb
56
+ - lib/icqbot/functional/chats/administration/set_about.rb
57
+ - lib/icqbot/functional/chats/administration/set_rules.rb
58
+ - lib/icqbot/functional/chats/administration/set_title.rb
56
59
  - lib/icqbot/functional/chats/get_admins.rb
57
60
  - lib/icqbot/functional/chats/get_blocked_users.rb
58
61
  - lib/icqbot/functional/chats/get_info.rb