lita-destiny 0.2.2 → 0.2.4

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: 01223fac8c8c2ec41489c1be0a51f65666654f98
4
- data.tar.gz: d8198502f5bfd9e4b9683465af858eb550b27523
3
+ metadata.gz: 30e3e1ec53692f7f643f2c4672be2915d78910ed
4
+ data.tar.gz: 5c54e9bacc87cf1537bd93a8023e74eefaf7c305
5
5
  SHA512:
6
- metadata.gz: 4c9c7aac948126b416050df65186068299456e1ba93acaa13a35ce315c967a79282b5ab582e4a909bc25c08e6f6f7f6d1adfb44b31d2b562f2f4aba511e1203e
7
- data.tar.gz: ef0f14ed1ad7d113d81e8e89be8d4d3268fd21a6d88fcb4460c96670a9190bf22b12afc2c7f63e58eda9aeb7a62e8ba1ddb573f5c6b16738ab66195d8eaa1c91
6
+ metadata.gz: 5913b40de4df443986d3dd2449f020c3f459edfcc7b2b04f63e96ef3355d33035c97d864ee6da50e970492092906f2e33a4d7caa944c00013a42bda4f32b6ce6
7
+ data.tar.gz: 09b30af63b70bec2463df59938318125ac7271bb24bdc007bb59420f68dee6d224406ef5c1b4943b74c59a79c92e23b073c2a0d714955ef1b5bf47508dfac0f2
@@ -134,7 +134,7 @@ module Lita
134
134
  # Builds response to bring Xur items into chat.
135
135
  #
136
136
  # TODO: Is slow due to each item having to be polled from Bungies server.
137
- def build_xur_message(response)
137
+ def build_xur_message(response, color)
138
138
  # Set up our client
139
139
  destiny_client = Destiny::Client.new(api_key)
140
140
  # Set xur to our clients xur method
@@ -186,7 +186,7 @@ module Lita
186
186
  parsed_skulls = destiny_client.skulls(skull).capitalize
187
187
  skulls << parsed_skulls
188
188
  end
189
- parsed_round = "Round #{index+1}: #{enemy}-- #{skulls.join(", ")}"
189
+ parsed_round = "Round #{index+1}: #{enemy} (#{skulls.join(", ")})"
190
190
  parsed_rounds << parsed_round
191
191
  end
192
192
 
@@ -198,14 +198,37 @@ module Lita
198
198
  parsed_skulls = destiny_client.skulls(skull).capitalize
199
199
  skulls << parsed_skulls
200
200
  end
201
- parsed_round = "Round 6: Skolas-- #{skulls.join(", ")}"
201
+ parsed_round = "Round 6: Skolas (#{skulls.join(", ")})"
202
202
  parsed_rounds << parsed_round
203
203
  end
204
204
 
205
- response.reply "*Level #{level} Prison of Elders*\n#{arena_name}\n#{arena_description}\n#{parsed_rounds.join("\n")}"
205
+ round_fields = []
206
+ parsed_rounds.each do |round|
207
+ round_hash = {
208
+ title: round,
209
+ value: "",
210
+ short: false
211
+ }
212
+ round_fields << round_hash
213
+ end
214
+ # Create our attachment structure
215
+ attachment_options = {
216
+
217
+ color: "#d35400",
206
218
 
219
+ title: "Level #{level} Prison of Elders: #{arena_name}",
207
220
 
221
+ text: "#{arena_description}",
208
222
 
223
+ fields: round_fields,
224
+
225
+ thumb_url: "http://i0.wp.com/planetdestiny.com/wp-content/uploads/2015/04/arena-icon.png"
226
+ }
227
+
228
+ text = "#{arena_description}"
229
+ # Create Attachment
230
+ attachment = Lita::Adapters::Slack::Attachment.new(text, attachment_options)
231
+ robot.chat_service.send_attachments(response.room, attachment)
209
232
  end
210
233
  end
211
234
 
data/lita-destiny.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-destiny"
3
- spec.version = "0.2.2"
3
+ spec.version = "0.2.4"
4
4
  spec.authors = ["PDaily"]
5
5
  spec.email = ["pat.irwin4@gmail.com"]
6
6
  spec.description = "Small lita.io handler for interacting with the Destiny API"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-destiny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - PDaily