twitch-bot 5.0.1 → 5.0.2

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: c93a3e736df843858523b560468c2e8f5b485753d962048a53a1d31288dac8e7
4
- data.tar.gz: 0bcecc94bf291ba8f1cbdd95643fef3fcb63dec42a60b19b6b4714a99412e48a
3
+ metadata.gz: 7e01b9b202dc484cc6f55788d1adc6cc7b6272c1bb3ff67fcb2e0615956ea761
4
+ data.tar.gz: d819d7d5be9b59fdbdf9bcb1ebb100272f79fcb8377a887ad3e4450aee3b437a
5
5
  SHA512:
6
- metadata.gz: 1dd1afaf1758e6e284286c574d6e1c97c7173431ecec73570394193e174afd8ed2216bf6f22cec76f4ac0c0b379b4fdcf0ef93d275664870b8247f0da2f880a7
7
- data.tar.gz: 2457c8f76af99c2b0293ffce6bc6269df1cc0c07f9a3aa54fbfb210e28c791f34e42eee7eeb89da00d523da6b9853454c8ad0b561d182667e80280f962253f76
6
+ metadata.gz: 96ab9830ae76529ef3f8f92e9876fb043e01afa2f7d4ee354dae4014e377df3f3e427c1a6f54dfdb515e7b2ec0018416f39874420f74e5659f8d83453b2d293b
7
+ data.tar.gz: 16a25b0062f8a1066442305ffc54c6d9ed1b573bfc836f990830f6c075738c6438876da82bdc4caa0220e88f1fa5e1cbd64ab151e7479fadb4dba00378dbda28
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog Twitch::Bot
2
2
 
3
+ ## v5.0.2
4
+
5
+ - [FIX] `PART` command caused a crash when not in a channel.
6
+
3
7
  ## v5.0.1
4
8
 
5
9
  - [FIX] Environment variable `REDIS_URL` now has precedence over configuration
@@ -9,6 +9,7 @@ module Twitch
9
9
  class Irc
10
10
  def initialize(client:)
11
11
  @client = client
12
+ @channel = nil
12
13
 
13
14
  open_socket
14
15
  end
@@ -29,7 +30,7 @@ module Twitch
29
30
  end
30
31
 
31
32
  def send_message(text)
32
- privmsg = "PRIVMSG ##{channel.name} :#{text}"
33
+ privmsg = "PRIVMSG ##{@channel.name} :#{text}"
33
34
  send_data(privmsg)
34
35
  end
35
36
 
@@ -37,19 +38,19 @@ module Twitch
37
38
  send_data_to_socket(data)
38
39
  end
39
40
 
40
- def join_channel(channel)
41
- @channel = channel
42
- send_data "JOIN ##{channel.name}"
41
+ def join_channel(channel_object)
42
+ @channel = channel_object
43
+ send_data "JOIN ##{@channel.name}"
43
44
  end
44
45
 
45
46
  def part_channel
46
- send_data "PART ##{channel.name}"
47
+ send_data "PART ##{@channel.name}" if @channel
47
48
  @channel = nil
48
49
  end
49
50
 
50
51
  private
51
52
 
52
- attr_reader :socket, :client, :channel
53
+ attr_reader :socket, :client
53
54
 
54
55
  def open_socket
55
56
  @socket = ::TCPSocket.new(
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Twitch
4
4
  module Bot
5
- VERSION = "5.0.1"
5
+ VERSION = "5.0.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitch-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jochen Lillich