twitch-bot 5.0.1 → 5.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +0 -24
- data/CHANGELOG.md +16 -0
- data/lib/twitch/bot/adapter/irc.rb +7 -6
- data/lib/twitch/bot/client.rb +1 -1
- data/lib/twitch/bot/memory/redis.rb +1 -1
- data/lib/twitch/bot/version.rb +1 -1
- 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: 8a9cd13d5b108b20673a4c971d882ca32538ed59cec9b53bbe96e810c114f72c
|
4
|
+
data.tar.gz: 10bf6db842e60d29b8e55ecb907110b31d01d19e625729caedb446ed7f947c83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f8b1e3f3c9685a624845f45c9da18e81081f2d471ef917f280f715741345c61dce68b9af4941e7d808a950af85027afc651da384adbffa291ea39c5a763611c
|
7
|
+
data.tar.gz: 8ec7e264de9418e546ee1f885dc196f7d35541fe0b93da957928937f4030f30f5fad3534d512c7afffb4f63479a6067b4a50ce0e7302ef0e1e91efa2e928be75
|
data/.github/workflows/main.yml
CHANGED
@@ -27,27 +27,3 @@ jobs:
|
|
27
27
|
bundle exec rake test
|
28
28
|
env:
|
29
29
|
REDIS_URL: 'redis://redis:6379'
|
30
|
-
|
31
|
-
release:
|
32
|
-
if: startsWith(github.ref, 'refs/tags/v')
|
33
|
-
needs: test
|
34
|
-
runs-on: ubuntu-latest
|
35
|
-
steps:
|
36
|
-
- uses: actions/checkout@v2
|
37
|
-
- name: Setup
|
38
|
-
uses: actions/setup-ruby@v1
|
39
|
-
with:
|
40
|
-
ruby-version: 2.6.x
|
41
|
-
- name: Bundle
|
42
|
-
run: |
|
43
|
-
gem install bundler
|
44
|
-
bundle install --jobs 4 --retry 3
|
45
|
-
- name: Publish to RubyGems
|
46
|
-
run: |
|
47
|
-
mkdir -p $HOME/.gem
|
48
|
-
touch $HOME/.gem/credentials
|
49
|
-
chmod 0600 $HOME/.gem/credentials
|
50
|
-
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
51
|
-
rake release
|
52
|
-
env:
|
53
|
-
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# Changelog Twitch::Bot
|
2
2
|
|
3
|
+
## v5.0.5
|
4
|
+
|
5
|
+
- [FIX] Catch missing channel object.
|
6
|
+
|
7
|
+
## v5.0.4
|
8
|
+
|
9
|
+
- [FIX] Handle `nil` values from Redis.
|
10
|
+
|
11
|
+
## v5.0.3
|
12
|
+
|
13
|
+
- [FIX] Remove CI release stage broken by Rubygems OTP.
|
14
|
+
|
15
|
+
## v5.0.2
|
16
|
+
|
17
|
+
- [FIX] `PART` command caused a crash when not in a channel.
|
18
|
+
|
3
19
|
## v5.0.1
|
4
20
|
|
5
21
|
- [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(
|
41
|
-
@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
|
53
|
+
attr_reader :socket, :client
|
53
54
|
|
54
55
|
def open_socket
|
55
56
|
@socket = ::TCPSocket.new(
|
data/lib/twitch/bot/client.rb
CHANGED
data/lib/twitch/bot/version.rb
CHANGED