slackbotsy 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce0da4a7d0888d5db3de53e15e4735fa5c4964bf
4
- data.tar.gz: de9207d9d5a94e91d4efdb28c66a1d9164161dbd
3
+ metadata.gz: 1541278505c1973d7a12af39d7c44be6d95aa6ad
4
+ data.tar.gz: a21fdba46ea03e1c9ade798b1ff3e183c13b0180
5
5
  SHA512:
6
- metadata.gz: f6bd18dec8b80138b81ac4bab5386cead3eaf6df8c81b971777a68ab6fc7c4a607a3ac14351afa22d37ed8008c5b842dfcb7f87677443a976b05db4710ea8450
7
- data.tar.gz: dcec448b9a05d8006071ba52656d75665fb24807ef093854c9f38e63fc294315bbabbcf724775915914a6117d2e84dcafcf5dd755b4278e92c27ef5b97950abb
6
+ metadata.gz: 9bbf5210fc9324df30100423fc4924bd0f1eaf8e60a7814048512c0b9776958a91ad7e971a5f3dada0f7933e82e0c0abd2d3eb11b6df0f9b75a984d3607507a0
7
+ data.tar.gz: 59dc50d47fb889236cda224cef7bb575bf26c797bb52118c6bbc9d4cabedf2ebc3d0585abf08e2cbd8add0def7455947588f6aa6572700a696f9405cf0a18686
@@ -75,6 +75,7 @@ module Slackbotsy
75
75
  payload[:channel] = payload[:channel].gsub(/^#?/, '#') # chat.postMessage needs leading # on channel
76
76
  @api.join(payload[:channel])
77
77
  @api.post_message(payload)
78
+ return nil # be quiet in webhook reply
78
79
  end
79
80
 
80
81
  ## simple wrapper on api.upload (which calls files.upload)
@@ -86,6 +87,7 @@ module Slackbotsy
86
87
  channels.find { |c| name.match(/^#?#{c['name']}$/) }.fetch('id') # convert channel id to name
87
88
  end.join(',')
88
89
  @api.upload(payload)
90
+ return nil # be quiet in webhook reply
89
91
  end
90
92
 
91
93
  ## record a description of the next hear block, for use in help
@@ -8,6 +8,7 @@ module Slackbotsy
8
8
  super()
9
9
  self.update(msg)
10
10
  @caller = caller # bot object
11
+ @bot = caller # alias for bot object
11
12
  end
12
13
 
13
14
  ## convenience wrapper in message scope, so we can call it without @caller
@@ -16,16 +17,22 @@ module Slackbotsy
16
17
  @caller.post({ channel: self['channel_name'] }.merge(options))
17
18
  end
18
19
 
19
- ## ditto
20
20
  def say(text, options = {})
21
21
  @caller.say(text, { channel: self['channel_name'] }.merge(options))
22
22
  end
23
23
 
24
- ## ditto
25
24
  def attach(attachments, options = {})
26
25
  @caller.attach(attachments, { channel: self['channel_name'] }.merge(options))
27
26
  end
28
27
 
28
+ def post_message(text, options = {})
29
+ @caller.post_message(text, { channel: self['channel_name'] }.merge(options))
30
+ end
31
+
32
+ def upload(options = {})
33
+ @caller.upload({ channel: self['channel_name'] }.merge(options))
34
+ end
35
+
29
36
  ## convenience getter methods for message properties
30
37
  %w[ token team_id channel_id channel_name timestamp user_id user_name text ].each do |method|
31
38
  define_method(method) do
@@ -1,3 +1,3 @@
1
1
  module Slackbotsy
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slackbotsy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Lister
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-13 00:00:00.000000000 Z
11
+ date: 2015-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  version: '0'
120
120
  requirements: []
121
121
  rubyforge_project:
122
- rubygems_version: 2.2.3
122
+ rubygems_version: 2.4.5
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: Ruby bot for Slack chat.