twitch-bot 4.1.0 → 4.1.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/command_handler.rb +4 -0
- data/lib/twitch/bot/event_handler.rb +15 -9
- data/lib/twitch/bot/version.rb +1 -1
- data/spec/twitch/bot/command_handler_spec.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b95458f55a188c3e08f200675f0147561f9316aea8eeac3f570eb5a1f984e755
|
4
|
+
data.tar.gz: b63b75edbe1b0f2fa6f31e8e0ca1064e8a6c6b0cf9defd9f91f13646ca48fdc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b1be2870429a4748980a9490749181275a0d59ac9cae46be6538e7a93e98dcbd6fbdf6614b9a6701e508156e35d5db77c98685ea44dcae8263461a3dc8f58e9
|
7
|
+
data.tar.gz: a6be65d6a5369df67ec3243c7c17313a45fb7df135ea862c0b04e92b2d5ac6953c18993277e33772f373dfbdc6d46154edfc36e287788c6f388e5829a80104a7
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,21 @@ module Twitch
|
|
6
6
|
class EventHandler
|
7
7
|
attr_reader :event, :client
|
8
8
|
|
9
|
+
#
|
10
|
+
# Return a list of event types this handler subscribes to
|
11
|
+
#
|
12
|
+
# @return [Array] list of event types
|
13
|
+
#
|
14
|
+
def self.handled_events
|
15
|
+
[]
|
16
|
+
end
|
17
|
+
|
18
|
+
#
|
19
|
+
# Inititalize an event handler object
|
20
|
+
#
|
21
|
+
# @parameter event The latest event of a subscribed type
|
22
|
+
# @parameter client The current chat client object
|
23
|
+
#
|
9
24
|
def initialize(event:, client:)
|
10
25
|
@event = event
|
11
26
|
@client = client
|
@@ -19,15 +34,6 @@ module Twitch
|
|
19
34
|
def call
|
20
35
|
raise "Unhandled #{event.type}"
|
21
36
|
end
|
22
|
-
|
23
|
-
#
|
24
|
-
# Return a list of event types this handler can handle
|
25
|
-
#
|
26
|
-
# @return [Array] event type list
|
27
|
-
#
|
28
|
-
def self.handled_events
|
29
|
-
[]
|
30
|
-
end
|
31
37
|
end
|
32
38
|
end
|
33
39
|
end
|
data/lib/twitch/bot/version.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
RSpec.describe Twitch::Bot::CommandHandler do
|
4
|
+
it "responds to user_message" do
|
5
|
+
expect(described_class.handled_events).to include(:user_message)
|
6
|
+
end
|
7
|
+
|
4
8
|
it "responds to a known command" do
|
5
9
|
config = Twitch::Bot::Config.new
|
6
10
|
client = Twitch::Bot::Client.new(config: config)
|