twitch-bot 5.0.4 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +27 -5
- data/README.md +6 -3
- data/lib/twitch/bot/client.rb +1 -1
- data/lib/twitch/bot/command_handler.rb +3 -9
- data/lib/twitch/bot/version.rb +1 -1
- data/spec/twitch/bot/command_handler_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e3c6fd50dbbfee645d9e1d1365c9c3e756310afc0c0fb1ceb273621b322568e
|
4
|
+
data.tar.gz: cad818412d9fe349f2f642deccae0b56716817b66d78becef177ada32e99994a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be13203e5e095221da44e5cb642e243f76b2c8abc1ec6069487c24b7c410f40fb16746a6cf8533da46f227b97a8a04ca4dcccabc68e9d6e3c113fba352e96f32
|
7
|
+
data.tar.gz: ac9fc621f16aba451ae6f7754b2cb55d4efc1f31a06ac46b6b6ddb0551f8d5d1e16a42ed2f3e5a9457bb9a7dd25b3899b2765de1cc3612c210bb804ebb50b356
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Changelog Twitch::Bot
|
2
2
|
|
3
|
+
## v6.0.0
|
4
|
+
|
5
|
+
- [BREAKING] Refactor `command_handler` so that it doesn't require complex
|
6
|
+
constructors in child classes.
|
7
|
+
|
8
|
+
## v5.0.6
|
9
|
+
|
10
|
+
- [FIX] Use safe navigation properly.
|
11
|
+
|
12
|
+
## v5.0.5
|
13
|
+
|
14
|
+
- [FIX] Catch missing channel object.
|
15
|
+
|
3
16
|
## v5.0.4
|
4
17
|
|
5
18
|
- [FIX] Handle `nil` values from Redis.
|
@@ -36,15 +49,20 @@
|
|
36
49
|
|
37
50
|
## v4.0.0
|
38
51
|
|
39
|
-
* [BREAKING] Using `REDIS_HOST` and `REDIS_PORT` for the connection details in
|
52
|
+
* [BREAKING] Using `REDIS_HOST` and `REDIS_PORT` for the connection details in
|
53
|
+
`Twitch::Bot::Memory::Redis` was a bad choice. Providers like Heroku use a
|
54
|
+
combined `REDIS_URL` instead. So do we now. (Alternatively, there's still the
|
55
|
+
way via the `Config` object.)
|
40
56
|
|
41
57
|
## v3.2.1
|
42
58
|
|
43
|
-
* [FIXED] The Terminal adapter now returns all messages from the channel owner,
|
59
|
+
* [FIXED] The Terminal adapter now returns all messages from the channel owner,
|
60
|
+
allowing to test privileged functionality in dev mode.
|
44
61
|
|
45
62
|
## v3.2.0
|
46
63
|
|
47
|
-
* [NEW] This release introduces a `Memory::Redis` class that allows users to
|
64
|
+
* [NEW] This release introduces a `Memory::Redis` class that allows users to
|
65
|
+
provide their bot with a persistent memory storage.
|
48
66
|
|
49
67
|
## v3.1.0
|
50
68
|
|
@@ -52,7 +70,10 @@
|
|
52
70
|
|
53
71
|
## v3.0.0
|
54
72
|
|
55
|
-
* [BREAKING] Instead of choosing and creating the `Adapter` in the `Client`, we
|
73
|
+
* [BREAKING] Instead of choosing and creating the `Adapter` in the `Client`, we
|
74
|
+
now inject a `Config` class into `Client` that carries our choice of Adapter.
|
75
|
+
This change also makes the `Connection` class obsolete; its information went
|
76
|
+
into `Config` as well.
|
56
77
|
|
57
78
|
## v2.1.1
|
58
79
|
|
@@ -66,7 +87,8 @@
|
|
66
87
|
## v2.0.0
|
67
88
|
|
68
89
|
* [BREAKING] The standard text message class is now named
|
69
|
-
`Twitch::Bot::Message::UserMessage` and uses the type symbol `:user_message`.
|
90
|
+
`Twitch::Bot::Message::UserMessage` and uses the type symbol `:user_message`.
|
91
|
+
It has added methods to handle bot commands.
|
70
92
|
* [CHANGED] Major restructuring of both class hierarchy and class responsibilities.
|
71
93
|
|
72
94
|
## v1.0.0 Initial release
|
data/README.md
CHANGED
@@ -2,9 +2,11 @@
|
|
2
2
|
|
3
3
|
![](https://github.com/geewiz/twitch-bot/workflows/Ruby%20Gem/badge.svg)
|
4
4
|
|
5
|
-
`twitch-bot` provides a Twitch chat client object that can be used for building
|
5
|
+
`twitch-bot` provides a Twitch chat client object that can be used for building
|
6
|
+
Twitch chat bots.
|
6
7
|
|
7
|
-
This gem is based on
|
8
|
+
This gem is based on
|
9
|
+
[`twitch-chat`](https://github.com/EnotPoloskun/twitch-chat).
|
8
10
|
|
9
11
|
## Installation
|
10
12
|
|
@@ -28,7 +30,8 @@ $ gem install twitch-bot
|
|
28
30
|
|
29
31
|
## Usage
|
30
32
|
|
31
|
-
Refer to the [Teneggs](https://www.github.com/geewiz/teneggs) repository for an
|
33
|
+
Refer to the [Teneggs](https://www.github.com/geewiz/teneggs) repository for an
|
34
|
+
example bot implementation.
|
32
35
|
|
33
36
|
## Supported event types
|
34
37
|
|
data/lib/twitch/bot/client.rb
CHANGED
@@ -8,25 +8,19 @@ module Twitch
|
|
8
8
|
[:user_message]
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
12
|
-
|
13
|
-
@command_aliases = []
|
11
|
+
def command_aliases
|
12
|
+
[]
|
14
13
|
end
|
15
14
|
|
15
|
+
# FIXME: Does this have to be public only for testing?
|
16
16
|
def call
|
17
17
|
if event.command? && command_aliases.include?(event.command)
|
18
18
|
handle_command
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
def command_alias(command_alias)
|
23
|
-
@command_aliases << command_alias
|
24
|
-
end
|
25
|
-
|
26
22
|
private
|
27
23
|
|
28
|
-
attr_reader :command_aliases
|
29
|
-
|
30
24
|
def handle_command
|
31
25
|
raise NotImplementedError
|
32
26
|
end
|
data/lib/twitch/bot/version.rb
CHANGED
@@ -13,7 +13,7 @@ RSpec.describe Twitch::Bot::CommandHandler do
|
|
13
13
|
user: "testuser",
|
14
14
|
)
|
15
15
|
handler = described_class.new(event: message, client: client)
|
16
|
-
handler.
|
16
|
+
allow(handler).to receive(:command_aliases).and_return(["mycommand"])
|
17
17
|
allow(handler).to receive(:handle_command)
|
18
18
|
|
19
19
|
handler.call
|
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:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jochen Lillich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|