icqbot 0.1.1 → 0.1.6

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: 0a2b93dc489f8308a4ce781d79b2e797189d464d4f285449a2f8ef01b1a45a3c
4
- data.tar.gz: f9f268a15b98f0cf710ed87ea43a6edb348b7f39445506e884f0b859b9bdd4e2
3
+ metadata.gz: 8a1b8905027bb3b08fccc7709c576dc9f8d12f3dab7aae4198c7a6f4206eeaf6
4
+ data.tar.gz: e86af0281b524e830d38368a7956d9c88ff77d87235bcdc2bee3448c736bba7e
5
5
  SHA512:
6
- metadata.gz: e792f9b3c3693500645dc3fa772d23140de16e85f6a2d0fa01f1618a50be7dd5597e6a7d9f5d6dc4b9616ba86d7b9f3ae423ae996fb58c74b656d1ff2c77457a
7
- data.tar.gz: 98e908b1f8caca89d2f5e3d7b054f5a9b95d8d03c9ff4c0844604a926825967ba2c6e15f79eea9f317b6bf2be096b0fe94782acc12026a607a79916d5f8b0941
6
+ metadata.gz: 3b78278215ab10db856f55b908fc045fd1793ca0e1de0d4afc9f7a6b7986c19697e2b3ad6acb1d68d5b023c66bfc14acba9177d092d43f8a13f61321c9677090
7
+ data.tar.gz: c419c1cfc80b5896666307eb9cb369f9fc4a1f337263f8406313094514717d1bee4cec9e64d9b21c654f5cfbf325af200f54020c2de3db033819708518f74604
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  .bundle
2
2
  test
3
3
  Gemfile.lock
4
+ *.gem
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- icq-bot-ruby in working :zzz:
2
+ icq-bot-ruby :diamonds:
3
3
  ------------
4
4
  Ruby wrapper for [ICQ Bot API](https://icq.com/botapi/)
5
5
 
@@ -21,7 +21,11 @@ ICQ::Bot.new('token') do |bot|
21
21
  end
22
22
  end
23
23
  ```
24
+ more examples in `bin/`
24
25
 
25
- ### Credits
26
+ ## Docs
27
+ * **[Documentation](./doc/overview.md)**
28
+
29
+ ## Credits
26
30
  * Thank you Cyril David (author by gem requests)
27
31
  * And thank you Matz for wonderful Ruby
@@ -0,0 +1,13 @@
1
+ require 'icqbot'
2
+
3
+ bot = ICQ::Bot.new('TOKEN')
4
+
5
+ bot.add_event_handler '/help', -> (event) do
6
+ bot.send_msg 'command help don\'t work', event.chat_id
7
+ end
8
+
9
+ bot.add_event_handler '/disable', -> (event) do
10
+ exit 0
11
+ end
12
+
13
+ bot.listen {}
@@ -0,0 +1,139 @@
1
+
2
+ Bot
3
+ ---
4
+
5
+ File: `lib/icqbot/bot.rb`
6
+
7
+ ---
8
+
9
+ ## Конструктор
10
+ ```ruby
11
+ def initialize token, pool_time=30
12
+ ```
13
+
14
+ ## Event loop
15
+ ```ruby
16
+ def listen
17
+ ```
18
+ Принимает блок, которому передаётся экземпляр класса [Event](./event.md)(последние событие)
19
+
20
+ ## Закрыть Event loop
21
+ Чтобы закрыть цикл нужно аттрибуту объекта Bot `loop` установить `false`.
22
+ ```ruby
23
+ bot.loop = false
24
+ ```
25
+
26
+ ## Добавить event handler(обработчик событий)
27
+ ```ruby
28
+ def add_event_handler name, handler
29
+ ```
30
+ 1. `name` - имя события.
31
+ 2. `handler` - анонимная функция(принимает объект типа [Event](./event.md)), которая сработает при получение события с текстом идентичном названию обработчику.
32
+
33
+ ## Добавить callback event handler
34
+ ```ruby
35
+ def add_callback_event_handler name, handler
36
+ ```
37
+ 1. `name` - имя события.
38
+ 2. `handler` - анонимная функция(принимает объект типа [Event](./event.md)), которая сработает при получение callback события с идентификатор идентичным названию обработчика.
39
+
40
+ ## Отправить сообщение
41
+ ```ruby
42
+ def send_msg msg, chat_id # -> Hash
43
+ ```
44
+ 1. `msg` - это объект типа [Message](./message.md), либо обычный String.
45
+ 2. `chat_id` - ID чата, куда надо отправить сообщение.
46
+
47
+ ## Удалить сообщение
48
+ ```ruby
49
+ def delete_msg msg_id, chat_id # -> Hash
50
+ ```
51
+ 1. `msg_id` - ID сообщения, которое надо удалить.
52
+ 2. `chat_id` - ID чата, откуда надо удалить сообщение.
53
+
54
+ ## Изменить сообщение
55
+ ```ruby
56
+ def edit_msg msg, msg_id, chat_id # -> Hash
57
+ ```
58
+ 1. `msg` - это объект типа [Message](./message.md), либо обычный String.
59
+ 2. `msg_id` - ID сообщения, которое надо изменить.
60
+ 3. `chat_id` - ID чата, где надо изменить сообщение.
61
+
62
+ # Chats
63
+
64
+ ## Получить информацию о чате
65
+ ```ruby
66
+ def get_info chat_id # -> Hash | User
67
+ ```
68
+ 1. `chat_id` - ID чата, информацию о котором надо получить.
69
+
70
+ ## Получить список участников
71
+ ```ruby
72
+ def get_members chat_id, cursor=nil # -> [Hash]
73
+ ```
74
+ 1. `chat_id` - ID чата, откуда надо получить список участников.
75
+
76
+ ## Получить список заблокированных пользователей
77
+ ```ruby
78
+ def get_blocked_users chat_id # -> [Hash]
79
+ ```
80
+ 1. `chat_id` - ID чата, откуда надо получить список заблокированных пользователей.
81
+
82
+ ## Получить список aдминов
83
+ ```ruby
84
+ def get_admins chat_id # -> [Hash]
85
+ ```
86
+ 1. `chat_id` - ID чата, откуда надо получить список aдминов.
87
+
88
+ # Chat administration
89
+ Для работы этих методов бот должен иметь права администрации.
90
+
91
+ ## Установка названия чата
92
+ ```ruby
93
+ def set_title chat_id, title # -> Hash
94
+ ```
95
+ 1. `chat_id` - ID чата.
96
+ 2. `title` - новое название чата.
97
+
98
+ ## Установка описания чата
99
+ ```ruby
100
+ def set_about chat_id, about # -> Hash
101
+ ```
102
+ 1. `chat_id` - ID чата.
103
+ 2. `about` - новое описание чата.
104
+
105
+ ## Установка правил чата
106
+ ```ruby
107
+ def set_rules chat_id, rules # -> Hash
108
+ ```
109
+ 1. `chat_id` - ID чата.
110
+ 2. `rules` - правила чата.
111
+
112
+ ## Закрепить сообщение
113
+ ```ruby
114
+ def pin_msg msg_id, chat_id # -> Hash
115
+ ```
116
+ 1. `msg_id` - ID сообщения, что нужно закрепить.
117
+ 2. `chat_id` - ID чата.
118
+
119
+ ## Открепить сообщение
120
+ ```ruby
121
+ def unpin_msg msg_id, chat_id # -> Hash
122
+ ```
123
+ 1. `msg_id` - ID сообщения, что нужно открепить.
124
+ 2. `chat_id` - ID чата.
125
+
126
+ ## Забанить участника
127
+ ```ruby
128
+ def block_user user_id, chat_id, del_last_msg=false # -> Hash
129
+ ```
130
+ 1. `user_id` - ID пользователя, который должен отлететь в бан.
131
+ 2. `chat_id` - ID чата, где забанят.
132
+ 3. `del_last_msg` - удалить или нет последние сообщение пользователя.
133
+
134
+ ## Разбанить участника
135
+ ```ruby
136
+ def unblock_user user_id, chat_id # -> Hash
137
+ ```
138
+ 1. `user_id` - ID пользователя, который должен вернуться из бана.
139
+ 2. `chat_id` - ID чата, где разабанят.
@@ -0,0 +1,12 @@
1
+
2
+ Button
3
+ ---
4
+
5
+ ## Конструктор
6
+ ```ruby
7
+ def initialize text, style:'attention', url:nil, call_back_data:nil
8
+ ```
9
+ 1. `text` - текст кнопки(String).
10
+ 2. `style` - стиль кнопки.
11
+ 3. `url` - ссылка, по которой отправит вас кнопка.
12
+ 4. `call_back_data` - код для ответа.
@@ -0,0 +1,41 @@
1
+
2
+ Event
3
+ ---
4
+
5
+ File: `lib/icqbot/event.rb`
6
+
7
+ ---
8
+ Класс для представления событий.
9
+
10
+ ## Конструктор
11
+ ```ruby
12
+ def initialize event_h
13
+ ```
14
+ Принимает hash event из ICQ Bot API.
15
+
16
+ ## Аттрибуты
17
+ ```ruby
18
+ attr_reader :type, :text, :msg_id, :chat_id, :from,
19
+ :data, :query_id
20
+ ```
21
+ ```ruby
22
+ event.type # Тип события.
23
+ event.text # текст приходящего события(обычно текст сообщения от юзера).
24
+ event.msg_id # ID пришедшего сообщения.
25
+ event.chat_id # ID чата, в который пришло сообщения.
26
+ event.from # Hash | Информация от кого пришло сообщение.
27
+ # -- Аттрибуты для callback event --
28
+ event.data
29
+ event.query_id
30
+ ```
31
+
32
+
33
+ ## Типы событий
34
+ ```ruby
35
+ module TypeEvent
36
+ NEW_MSG = 'newMessage'
37
+ EDITED_MSG = 'editedMessage'
38
+ DELETED_MSG = 'deletedMessage'
39
+ CALLBACK = 'callbackQuery'
40
+ ... # in working
41
+ ```
@@ -0,0 +1,29 @@
1
+ Message
2
+ ---
3
+
4
+ File: `lib/icqbot/message.rb`
5
+
6
+ ---
7
+
8
+ ## Конструктор
9
+ ```ruby
10
+ def initialize text, *keyboard
11
+ ```
12
+ 1. `text` - текст сообщения(String).
13
+ 2. `*keyboard` - массив объектов [Button](./button.md).
14
+
15
+ ## Аттрибуты
16
+ ```ruby
17
+ attr_reader :text, :keyboard
18
+ msg.text # текст сообщения(String)
19
+ msg.keyboard # массив объектов Button
20
+ ```
21
+
22
+ ## Добавить кнопку
23
+ ```ruby
24
+ def << btn
25
+ ```
26
+ ```ruby
27
+ alias_method :append, :<<
28
+ ```
29
+ 1. `btn` - объект типа [Button](./button.md)
@@ -0,0 +1,11 @@
1
+
2
+ # overview of docs
3
+
4
+ *Пардон за мой французский*
5
+
6
+ | Класс | Описание |
7
+ | --- | --- |
8
+ | **[Bot](./bot.md)** | Экземпляр этого класса и есть ваш бот, что выполняет всевозможные действия |
9
+ | **[Event](./event.md)** | Представление для приходящих от API events |
10
+ | **[Message](./message.md)** | Класс, экземпляры которого можно передать в `send_msg` в качестве `msg` |
11
+ | **[User](./user.md)** | Класс для представления пользователя |
@@ -1,24 +1,26 @@
1
- lib = File.expand_path('../lib', __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
-
4
- Gem::Specification.new do |s|
5
- s.name = "icqbot"
6
- s.version = "0.1.1"
7
- s.authors = ["sheyber"]
8
- s.email = ["ukt1@ro.ru"]
9
- # s.license = 'MIT'
10
-
11
- s.summary = %q{Ruby wrapper for ICQ Bot API.}
12
- s.description = %q{This gem is a simple and minimalistic library for creating ICQ bots.}
13
- s.homepage = "https://github.com/sheyber/icqbot"
14
- s.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
15
-
16
- s.metadata["homepage_uri"] = s.homepage
17
-
18
- s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
- s.bindir = 'exe'
20
- s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
- s.require_paths = ['lib']
22
-
23
- s.add_dependency 'requests'
1
+ require_relative './lib/icqbot.rb'
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "icqbot"
8
+ s.version = ICQ::VERSION
9
+ s.authors = ["sheyber"]
10
+ s.email = ["ukt1@ro.ru"]
11
+ s.license = '0BSD'
12
+
13
+ s.summary = %q{Ruby wrapper for ICQ Bot API.}
14
+ s.description = %q{This gem is a simple and minimalistic library for creating ICQ bots.}
15
+ s.homepage = "https://github.com/sheyber/icqbot"
16
+ s.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
17
+
18
+ s.metadata["homepage_uri"] = s.homepage
19
+
20
+ s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ s.bindir = 'exe'
22
+ s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+ s.require_paths = ['lib']
24
+
25
+ s.add_dependency 'requests', '~> 1.0', '>= 1.0.2'
24
26
  end
@@ -6,4 +6,5 @@ require_relative './icqbot/user.rb'
6
6
  require_relative './icqbot/message.rb'
7
7
 
8
8
  module ICQ
9
+ VERSION = '0.1.6'
9
10
  end
@@ -7,6 +7,13 @@ require_relative './functional/send_msg.rb'
7
7
  require_relative './functional/edit_msg.rb'
8
8
  require_relative './functional/delete_msg.rb'
9
9
  require_relative './functional/chats/get_info.rb'
10
+ require_relative './functional/chats/get_admins.rb'
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
+ require_relative './functional/chats/administration/pin_unpin_msg.rb'
16
+ require_relative './functional/chats/administration/block_unblock_user.rb'
10
17
 
11
18
  module ICQ
12
19
 
@@ -18,6 +25,8 @@ module ICQ
18
25
  @pool_time = pool_time
19
26
  @last_event_id = 0
20
27
  @loop = true
28
+ @event_handlers = {}
29
+ @callback_event_handlers = {}
21
30
  yield self if block_given?
22
31
  end
23
32
 
@@ -36,18 +45,24 @@ module ICQ
36
45
  if events and events['events'] and events['events'] != []
37
46
  last_event = events['events'].last
38
47
  @last_event_id = last_event['eventId']
39
- yield ICQ::Event.new last_event
48
+ last_event = ICQ::Event.new last_event
49
+ if @event_handlers.has_key? last_event.text
50
+ @event_handlers[last_event.text].call last_event
51
+ elsif last_event.type == ICQ::TypeEvent::CALLBACK and @callback_event_handlers.has_key? last_event.data
52
+ @callback_event_handlers[last_event.text].call last_event
53
+ else
54
+ yield last_event
55
+ end
40
56
  end
41
57
  end
42
58
  end
43
59
 
44
- def last_event # FIXME: its can delete
45
- events = JSON::load(get_events.body)
46
- if events and events['events'] and events['events'] != []
47
- last_event = events['events'].last
48
- @last_event_id = last_event['eventId']
49
- yield ICQ::Event.new last_event
50
- end
60
+ def add_event_handler name, handler
61
+ @event_handlers[name] = handler
62
+ end
63
+
64
+ def add_callback_event_handler name, handler
65
+ @callback_event_handlers[name] = handler
51
66
  end
52
67
 
53
68
  private
@@ -2,25 +2,41 @@ require_relative '../icqbot.rb'
2
2
 
3
3
  module ICQ
4
4
 
5
+ BOT_PREFIX = '/'
6
+
5
7
  module TypeEvent
6
8
  NEW_MSG = 'newMessage'
7
9
  EDITED_MSG = 'editedMessage'
8
10
  DELETED_MSG = 'deletedMessage'
11
+ CALLBACK = 'callbackQuery'
9
12
  end
10
13
 
11
14
  class Event
12
- attr_reader :type, :text, :msg_id, :chat_id, :from
15
+ attr_reader :type, :text, :msg_id, :chat_id, :from,
16
+ :data, :query_id
13
17
 
14
18
  def initialize event_h
19
+ # TODO: больше информации
15
20
  @event_h = event_h
16
21
  @type = event_h['type']
17
- @text = event_h['payload']['text']
18
- @msg_id = event_h['payload']['msgId']
19
- @chat_id = event_h['payload']['chat']['chatId']
20
22
  @from = event_h['payload']['from']
23
+ if @type != ICQ::TypeEvent::CALLBACK
24
+ @text = event_h['payload']['text']
25
+ @msg_id = event_h['payload']['msgId']
26
+ @chat_id = event_h['payload']['chat']['chatId']
27
+ else
28
+ @data = event_h['payload']['callbackData']
29
+ @query_id = event_h['payload']['queryId']
30
+ @chat_id = event_h['message']['chat']['chatId']
31
+ end
32
+ end
33
+
34
+ def prefix?
35
+ @text[0] == ICQ::BOT_PREFIX if @text
21
36
  end
22
37
 
23
38
  def to_h; @event_h end
39
+ def to_s; "Event(#{@type}" + (@text ? ", #{@text}" : '') + ')' end
24
40
  end
25
41
 
26
42
  end
@@ -0,0 +1,27 @@
1
+ require_relative '../../../bot.rb'
2
+
3
+ module ICQ
4
+
5
+ class Bot
6
+ def block_user user_id, chat_id, del_last_msg=false
7
+ params = base_req_for_block_unblock_user user_id, chat_id, del_last_msg
8
+ JSON::load Requests.get(
9
+ URLS_API::BLOCK_USER, params: params).body
10
+ end
11
+
12
+ def unblock_user user_id, chat_id
13
+ params = base_req_for_block_unblock_user user_id, chat_id
14
+ JSON::load Requests.get(
15
+ URLS_API::UNBLOCK_USER, params: params).body
16
+ end
17
+
18
+ private
19
+ def base_req_for_block_unblock_user user_id, chat_id, del_last_msg=nil
20
+ params = base_req chat_id
21
+ params['userId'] = user_id
22
+ params['delLastMessages'] = del_last_msg if del_last_msg
23
+ return params
24
+ end
25
+ end
26
+
27
+ end
@@ -0,0 +1,21 @@
1
+ require_relative '../../../bot.rb'
2
+
3
+ module ICQ
4
+
5
+ class Bot
6
+ def pin_msg msg_id, chat_id
7
+ params = base_req chat_id
8
+ params['msgId'] = msg_id
9
+ JSON::load Requests.get(
10
+ URLS_API::PIN_MSG, params: params).body
11
+ end
12
+
13
+ def unpin_msg msg_id, chat_id
14
+ params = base_req chat_id
15
+ params['msgId'] = msg_id
16
+ JSON::load Requests.get(
17
+ URLS_API::UNPIN_MSG, params: params).body
18
+ end
19
+ end
20
+
21
+ end
@@ -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
@@ -0,0 +1,13 @@
1
+ require_relative '../../bot.rb'
2
+
3
+ module ICQ
4
+
5
+ class Bot
6
+ def get_admins chat_id
7
+ _ = JSON::load Requests.get(
8
+ URLS_API::GET_ADMINS, params: base_req(chat_id)).body
9
+ _['admins']
10
+ end
11
+ end
12
+
13
+ end
@@ -0,0 +1,13 @@
1
+ require_relative '../../bot.rb'
2
+
3
+ module ICQ
4
+
5
+ class Bot
6
+ def get_blocked_users chat_id
7
+ _ = JSON::load Requests.get(
8
+ URLS_API::GET_BLOCKED_USERS, params: base_req(chat_id)).body
9
+ _['users']
10
+ end
11
+ end
12
+
13
+ end
@@ -0,0 +1,14 @@
1
+ require_relative '../../bot.rb'
2
+
3
+ module ICQ
4
+
5
+ class Bot
6
+ def get_members chat_id, cursor=nil
7
+ # TODO: сделать что-то с cursor
8
+ _ = JSON::load Requests.get(
9
+ URLS_API::GET_MEMBRS, params: base_req(chat_id)).body
10
+ _['members']
11
+ end
12
+ end
13
+
14
+ end
@@ -9,6 +9,13 @@ module ICQ
9
9
  @text = obj
10
10
  @keyboard = keyboard
11
11
  end
12
+
13
+ def << btn
14
+ return @keyboard << btn if btn.is_a? ICQ::Button
15
+ raise ArgumentError.new 'btn must be a Button'
16
+ end
17
+
18
+ alias_method :append, :<<
12
19
  end
13
20
 
14
21
  class Button
@@ -1,8 +1,18 @@
1
1
 
2
2
  module URLS_API
3
- GET_EVENTS = 'https://api.icq.net/bot/v1/events/get'
4
- SEND_MSG = 'https://api.icq.net/bot/v1/messages/sendText'
5
- EDIT_MSG = 'https://api.icq.net/bot/v1/messages/editText'
6
- DEL_MSG = 'https://api.icq.net/bot/v1/messages/deleteMessages'
7
- GET_INFO = 'https://api.icq.net/bot/v1/chats/getInfo'
3
+ GET_EVENTS = 'https://api.icq.net/bot/v1/events/get'
4
+ SEND_MSG = 'https://api.icq.net/bot/v1/messages/sendText'
5
+ EDIT_MSG = 'https://api.icq.net/bot/v1/messages/editText'
6
+ DEL_MSG = 'https://api.icq.net/bot/v1/messages/deleteMessages'
7
+ GET_INFO = 'https://api.icq.net/bot/v1/chats/getInfo'
8
+ GET_ADMINS = 'https://api.icq.net/bot/v1/chats/getAdmins'
9
+ GET_MEMBRS = 'https://api.icq.net/bot/v1/chats/getMembers'
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'
14
+ PIN_MSG = 'https://api.icq.net/bot/v1​/chats​/pinMessage'
15
+ UNPIN_MSG = 'https://api.icq.net/bot/v1​/chats​/unpinMessage'
16
+ BLOCK_USER = 'https://api.icq.net/bot/v1​/chats/blockUser'
17
+ UNBLOCK_USER = 'https://api.icq.net/bot/v1​/chats/unblockUser'
8
18
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icqbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - sheyber
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-22 00:00:00.000000000 Z
11
+ date: 2020-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: requests
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
17
20
  - - ">="
18
21
  - !ruby/object:Gem::Version
19
- version: '0'
22
+ version: 1.0.2
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
24
30
  - - ">="
25
31
  - !ruby/object:Gem::Version
26
- version: '0'
32
+ version: 1.0.2
27
33
  description: This gem is a simple and minimalistic library for creating ICQ bots.
28
34
  email:
29
35
  - ukt1@ro.ru
@@ -35,13 +41,27 @@ files:
35
41
  - Gemfile
36
42
  - README.md
37
43
  - bin/5time_echo_and_end.rb
44
+ - bin/bot_with_events_handlers.rb
38
45
  - bin/echo_bot.rb
39
46
  - bin/send_text_with_button.rb
47
+ - doc/bot.md
48
+ - doc/button.md
49
+ - doc/event.md
50
+ - doc/message.md
51
+ - doc/overview.md
40
52
  - icqbot.gemspec
41
53
  - lib/icqbot.rb
42
54
  - lib/icqbot/bot.rb
43
55
  - lib/icqbot/event.rb
56
+ - lib/icqbot/functional/chats/administration/block_unblock_user.rb
57
+ - lib/icqbot/functional/chats/administration/pin_unpin_msg.rb
58
+ - lib/icqbot/functional/chats/administration/set_about.rb
59
+ - lib/icqbot/functional/chats/administration/set_rules.rb
60
+ - lib/icqbot/functional/chats/administration/set_title.rb
61
+ - lib/icqbot/functional/chats/get_admins.rb
62
+ - lib/icqbot/functional/chats/get_blocked_users.rb
44
63
  - lib/icqbot/functional/chats/get_info.rb
64
+ - lib/icqbot/functional/chats/get_members.rb
45
65
  - lib/icqbot/functional/delete_msg.rb
46
66
  - lib/icqbot/functional/edit_msg.rb
47
67
  - lib/icqbot/functional/send_msg.rb
@@ -49,7 +69,8 @@ files:
49
69
  - lib/icqbot/urls_api.rb
50
70
  - lib/icqbot/user.rb
51
71
  homepage: https://github.com/sheyber/icqbot
52
- licenses: []
72
+ licenses:
73
+ - 0BSD
53
74
  metadata:
54
75
  homepage_uri: https://github.com/sheyber/icqbot
55
76
  post_install_message: