twitch-bot 5.0.6 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6133a3ba914f7fd40da2b2f0f451b49a431bc02823820a7e75ca93322f0c340a
4
- data.tar.gz: 3c2e6b980f222d9971ea31eebe245dbad6328580dbb80f8628001401745014a7
3
+ metadata.gz: 8e3c6fd50dbbfee645d9e1d1365c9c3e756310afc0c0fb1ceb273621b322568e
4
+ data.tar.gz: cad818412d9fe349f2f642deccae0b56716817b66d78becef177ada32e99994a
5
5
  SHA512:
6
- metadata.gz: 7d92e3cca67e6e16cf2d226a71342cc91d58ce65982dbc3f98cb406e1556fc5a068747edf27e386ac1fb9c20162433c8aadcc41960ef68c795784e8b3146ae73
7
- data.tar.gz: 434259e844ddff31a768f4c4349d1eb7d621be9718f94060cdace86cdaca76c0f8effebf16c8f83f9ac74f91e4448e7f6612b865b6b03f73070c17f2d2700979
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 `Twitch::Bot::Memory::Redis` was a bad choice. Providers like Heroku use a combined `REDIS_URL` instead. So do we now. (Alternatively, there's still the way via the `Config` object.)
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, allowing to test privileged functionality in dev mode.
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 provide their bot with a persistent memory storage.
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 now inject a `Config` class into `Client` that carries our choice of Adapter. This change also makes the `Connection` class obsolete; its information went into `Config` as well.
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`. It has added methods to handle bot commands.
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
  ![](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 Twitch chat bots.
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 [`twitch-chat`](https://github.com/EnotPoloskun/twitch-chat).
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 example bot implementation.
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 initialize(event:, client:)
12
- super
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Twitch
4
4
  module Bot
5
- VERSION = "5.0.6"
5
+ VERSION = "6.0.0"
6
6
  end
7
7
  end
@@ -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.command_alias("mycommand")
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: 5.0.6
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-06-28 00:00:00.000000000 Z
11
+ date: 2022-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis