twitch-bot 5.0.6 → 6.0.0
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 +4 -4
- data/CHANGELOG.md +19 -5
- data/README.md +6 -3
- 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,10 @@
|
|
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
|
+
|
3
8
|
## v5.0.6
|
4
9
|
|
5
10
|
- [FIX] Use safe navigation properly.
|
@@ -44,15 +49,20 @@
|
|
44
49
|
|
45
50
|
## v4.0.0
|
46
51
|
|
47
|
-
* [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.)
|
48
56
|
|
49
57
|
## v3.2.1
|
50
58
|
|
51
|
-
* [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.
|
52
61
|
|
53
62
|
## v3.2.0
|
54
63
|
|
55
|
-
* [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.
|
56
66
|
|
57
67
|
## v3.1.0
|
58
68
|
|
@@ -60,7 +70,10 @@
|
|
60
70
|
|
61
71
|
## v3.0.0
|
62
72
|
|
63
|
-
* [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.
|
64
77
|
|
65
78
|
## v2.1.1
|
66
79
|
|
@@ -74,7 +87,8 @@
|
|
74
87
|
## v2.0.0
|
75
88
|
|
76
89
|
* [BREAKING] The standard text message class is now named
|
77
|
-
`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.
|
78
92
|
* [CHANGED] Major restructuring of both class hierarchy and class responsibilities.
|
79
93
|
|
80
94
|
## v1.0.0 Initial release
|
data/README.md
CHANGED
@@ -2,9 +2,11 @@
|
|
2
2
|
|
3
3
|

|
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
|
|
@@ -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
|