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 +4 -4
- data/lib/lita/handlers/destiny.rb +27 -4
- data/lita-destiny.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30e3e1ec53692f7f643f2c4672be2915d78910ed
|
4
|
+
data.tar.gz: 5c54e9bacc87cf1537bd93a8023e74eefaf7c305
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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}
|
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
|
201
|
+
parsed_round = "Round 6: Skolas (#{skulls.join(", ")})"
|
202
202
|
parsed_rounds << parsed_round
|
203
203
|
end
|
204
204
|
|
205
|
-
|
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