twitch-bot 3.2.0 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/twitch/bot/adapter/terminal.rb +9 -3
- data/lib/twitch/bot/version.rb +1 -1
- data/spec/twitch/bot/adapter/terminal_spec.rb +24 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 593044bf44aec13e9f1c91329ea6a32500315809cf03c10c847c3eb571d84b04
|
4
|
+
data.tar.gz: 19eac94cc9374a36af56528dbdce6a6969c57157034c6474a65e6e1550a8cbab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:)
|
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 =
|
38
|
+
input = read_terminal
|
37
39
|
Twitch::Bot::Message::UserMessage.new(
|
38
40
|
text: input,
|
39
|
-
user:
|
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
|
data/lib/twitch/bot/version.rb
CHANGED
@@ -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.
|
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-
|
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
|