kybus-bot 0.4.4 → 0.4.5

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: 770ceb23f2b040686b9337adb8a5687c2b28dba0c076eb46fdb821ba15bcb938
4
- data.tar.gz: 2e0a3b827a4390f00d03b6717994b9df5b2bbc284a76cf154e4bc189d8279f9e
3
+ metadata.gz: d09b1584001474f51cbe4085e6755ebc11b60aa24b1eef8bf9c8a9b574761148
4
+ data.tar.gz: 004db2811733eb668e6206f1d010be444c91eea4f3e5ccd7af439236fa1e167a
5
5
  SHA512:
6
- metadata.gz: '08c94625e9e4b288bc3f07bd827fffba932af381af77b8a142825dd254229c6a66f0c31c00444b7056f782cff2e123263bb636708a099e8102754ad9fe431933'
7
- data.tar.gz: d1a311b425287b4de3e6ead3409b4bb1183dccc6614bb66758168f120144e91dc5bf523378862e098b924fa7bc0cffd344a32477fa0f0abe546835d83cf07b31
6
+ metadata.gz: 375b62ad3c9beedce1f47cef05ab80acf6ff22365ecf82c685a5f61de50d68bff5c08e0acac12d9f387e18d9c3a0fdef1ca27e294a106e7b78cc186294eb84a4
7
+ data.tar.gz: 88bed84b3baba6dfadefe2536678b3308e9f1db923bba4baa8795ce52fe5050fa2540711209d0abc10fe33160db863dfd0704e36c773735e9f6f09ab4c7e4e7e
@@ -8,9 +8,10 @@ module Kybus
8
8
  # Wraps a debugging message inside a class.
9
9
  class DebugMessage < Kybus::Bot::Message
10
10
  # It receives a string with the raw text and the id of the channel
11
- def initialize(text, channel)
11
+ def initialize(text, channel, attachments = {})
12
12
  @text = text
13
13
  @channel = channel
14
+ @attachments = attachments
14
15
  end
15
16
 
16
17
  # Returns the channel id
@@ -0,0 +1,32 @@
1
+ require_relative 'base'
2
+ require_relative 'adapters/debug'
3
+
4
+ module Kybus
5
+ module Bot
6
+ class Base
7
+ CONFIG = {
8
+ 'name' => 'test',
9
+ 'state_repository' => {
10
+ 'name' => 'json',
11
+ 'storage' => 'storage'
12
+ },
13
+ 'pool_size' => 1,
14
+ 'provider' => {
15
+ 'name' => 'debug',
16
+ 'echo' => true,
17
+ 'channels' => { 'testing' => [] }
18
+ }
19
+ }.freeze
20
+
21
+ def self.make_test_bot
22
+ new(CONFIG)
23
+ end
24
+
25
+ def receives(msg, attachments = {})
26
+ msg = ::Kybus::Bot::Adapter::DebugMessage.new(msg, 'testing', attachments)
27
+ @last_message = msg
28
+ process_message(msg)
29
+ end
30
+ end
31
+ end
32
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kybus
4
4
  module Bot
5
- VERSION = '0.4.4'
5
+ VERSION = '0.4.5'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kybus-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gilberto Vargas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-24 00:00:00.000000000 Z
11
+ date: 2022-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kybus-core
@@ -222,6 +222,7 @@ files:
222
222
  - lib/kybus/bot/command_definition.rb
223
223
  - lib/kybus/bot/message.rb
224
224
  - lib/kybus/bot/migrator.rb
225
+ - lib/kybus/bot/test.rb
225
226
  - lib/kybus/bot/testing.rb
226
227
  - lib/kybus/bot/version.rb
227
228
  homepage: https://github.com/tachomex/kybus