enerbot-slack 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/enerbot-slack.rb +1 -0
- data/lib/modules/slack_client.rb +1 -1
- data/lib/modules/slack_console.rb +3 -4
- data/lib/modules/slack_realtime.rb +4 -0
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd9030df69e73980c92158b45d884e250c0829c2f38a4eb2fbe29c25b15561e2
|
4
|
+
data.tar.gz: a5f9540078e64269bb8249a98c4d2e1f1fe72fee16a390bb01d65cc875cc9212
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6eaf009cb4278106508a16ae012d16536d429ec28a3f45af3dbf2e213e54b06ce9261db870902ce998353cf00deee247adc01cf050aaf4f6fad8b3ccdfd84d6c
|
7
|
+
data.tar.gz: 401484f57ec4878d4742a9ff5f5a4f200ef951b8a17b067a02f89aab345b4ba91ad96afe7a785158ec72f1efd553c702044d8a4a650e6fbf431b97a73e2312f5
|
data/lib/enerbot-slack.rb
CHANGED
data/lib/modules/slack_client.rb
CHANGED
@@ -4,7 +4,7 @@ require 'slack-ruby-client'
|
|
4
4
|
|
5
5
|
# Client initialization that powers the rest of interactions
|
6
6
|
module SlackClient
|
7
|
-
def configure_client(type = 'web', token =
|
7
|
+
def configure_client(type = 'web', token = @bot_token)
|
8
8
|
Slack.configure do |config|
|
9
9
|
config.token = token
|
10
10
|
config.raise 'Missing Bot token' unless config.token
|
@@ -2,7 +2,7 @@ require 'colorize'
|
|
2
2
|
require_relative 'slack_search'
|
3
3
|
|
4
4
|
# Module to read data from Slack and show it on console
|
5
|
-
module
|
5
|
+
module SlackConsole
|
6
6
|
include SlackSearch
|
7
7
|
|
8
8
|
def format_new_message(data)
|
@@ -10,16 +10,15 @@ module ConsoleSlack
|
|
10
10
|
data.username
|
11
11
|
else
|
12
12
|
user = get_user_info(data.user)
|
13
|
-
user.
|
13
|
+
user.name
|
14
14
|
end
|
15
15
|
text = data.text
|
16
16
|
channel_p = conversation_info(data.channel)
|
17
17
|
if @current_channel == channel_p.id
|
18
|
-
print "\n#{user_p}: ".yellow + text.blue
|
19
18
|
else
|
20
19
|
print "\n--- #{channel_p.name} ---".green
|
21
|
-
print "\n#{user_p}: ".yellow + text.blue
|
22
20
|
end
|
21
|
+
print "\n#{user_p}: ".yellow + text.blue
|
23
22
|
@current_channel = channel_p.id
|
24
23
|
end
|
25
24
|
end
|
@@ -20,6 +20,10 @@ module SlackRealTime
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def single_client(output = ENV['SLACK_DEFAULT_OUTPUT'])
|
23
|
+
@time_client.on :hello do
|
24
|
+
puts("Connected to '#{@time_client.team.name}' team at https://#{@time_client.team.domain}.slack.com.")
|
25
|
+
end
|
26
|
+
|
23
27
|
@time_client.on :message do |data|
|
24
28
|
share_message(data, output)
|
25
29
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enerbot-slack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luciano Adonis
|
@@ -11,61 +11,61 @@ cert_chain: []
|
|
11
11
|
date: 2024-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: async-websocket
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.8.
|
19
|
+
version: 0.8.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.8.
|
26
|
+
version: 0.8.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: bson_ext
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: colorize
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.8.
|
47
|
+
version: 0.8.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.8.
|
54
|
+
version: 0.8.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: slack-ruby-client
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 2.0.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 2.0.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|