twitch-bot 3.2.0 → 3.2.1

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: 7f73427a772e3b29804f8ef6066b2d4ea44259f0c095218a9e63b1caddae7dd3
4
- data.tar.gz: 282e8a62f638085d855c1a6fca1717b314b0f5b3fe6671fb5e4c07fd32e4bf17
3
+ metadata.gz: 593044bf44aec13e9f1c91329ea6a32500315809cf03c10c847c3eb571d84b04
4
+ data.tar.gz: 19eac94cc9374a36af56528dbdce6a6969c57157034c6474a65e6e1550a8cbab
5
5
  SHA512:
6
- metadata.gz: 72e2a1d4d0292645703d1110109004d2b20b346decd30677432dc5d3890c39b5a869a9b2cc31774e9adf37ffbe4fcaf90ec1d7a6f1784756f032100603f0826c
7
- data.tar.gz: 41e166ebb07600f9d667bee2c88599e0c51874b572b63a9e3ded8047f67fbe339e9be7e1b753df0a935ae251748a09b49891c6c65f4832976fa9a8e64718ee20
6
+ metadata.gz: 40e85ac406718f664c217c1c3dcf681cb5c58d03a95856c7f6063b27d478e7b014b8fe53b364f536e756ae7f52be631c0fe543c140e1b9200b5a01675b261d91
7
+ data.tar.gz: 63cb2c49bbbf0be7b71a5f81f56fcdc96fcff8af6e5a15d12084181edde63898e77633260c83450a15a46bb5f3587b71c727b95b570ba8a306d453cdedb84554
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog Twitch::Bot
2
2
 
3
+ ## v3.2.1
4
+
5
+ * [FIXED] The Terminal adapter now returns all messages from the channel owner, allowing to test privileged functionality in dev mode.
6
+
3
7
  ## v3.2.0
4
8
 
5
9
  * [NEW] This release introduces a `Memory::Redis` class that allows users to provide their bot with a persistent memory storage.
@@ -5,7 +5,9 @@ module Twitch
5
5
  module Adapter
6
6
  # This adapter connects the chat client to the terminal
7
7
  class Terminal
8
- def initialize(client:); end
8
+ def initialize(client:)
9
+ @client = client
10
+ end
9
11
 
10
12
  def connect; end
11
13
 
@@ -33,12 +35,16 @@ module Twitch
33
35
 
34
36
  def read_message_from_terminal
35
37
  Twitch::Bot::Logger.debug "Waiting for input..."
36
- input = gets
38
+ input = read_terminal
37
39
  Twitch::Bot::Message::UserMessage.new(
38
40
  text: input,
39
- user: "tester",
41
+ user: client.channel.name,
40
42
  )
41
43
  end
44
+
45
+ def read_terminal
46
+ gets
47
+ end
42
48
  end
43
49
  end
44
50
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Twitch
4
4
  module Bot
5
- VERSION = "3.2.0"
5
+ VERSION = "3.2.1"
6
6
  end
7
7
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.describe Twitch::Bot::Adapter::Terminal do
4
+ describe "#receive_message" do
5
+ it "receives all messages from channel owner" do
6
+ config = Twitch::Bot::Config.new(
7
+ settings: {
8
+ bot_user: "testuser",
9
+ adapter: "Twitch::Bot::Adapter::Terminal",
10
+ },
11
+ )
12
+ client = Twitch::Bot::Client.new(
13
+ config: config,
14
+ channel: "testchannel",
15
+ )
16
+ adapter = described_class.new(client: client)
17
+ allow(adapter).to receive(:read_terminal).and_return("Hello")
18
+
19
+ message = adapter.read_data
20
+
21
+ expect(message.user).to eq client.channel.name
22
+ end
23
+ end
24
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitch-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jochen Lillich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-24 00:00:00.000000000 Z
11
+ date: 2020-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -220,6 +220,7 @@ files:
220
220
  - lib/twitch/bot/message_parser.rb
221
221
  - lib/twitch/bot/version.rb
222
222
  - spec/spec_helper.rb
223
+ - spec/twitch/bot/adapter/terminal_spec.rb
223
224
  - spec/twitch/bot/client_spec.rb
224
225
  - spec/twitch/bot/config_spec.rb
225
226
  - spec/twitch/bot/memory/hash_spec.rb
@@ -253,6 +254,7 @@ summary: twitch-bot is a Twitch chat client that uses Twitch IRC that can be use
253
254
  as a Twitch chat bot engine.
254
255
  test_files:
255
256
  - spec/spec_helper.rb
257
+ - spec/twitch/bot/adapter/terminal_spec.rb
256
258
  - spec/twitch/bot/client_spec.rb
257
259
  - spec/twitch/bot/config_spec.rb
258
260
  - spec/twitch/bot/memory/hash_spec.rb