Class: Lita::Handlers::DestinyHandler

Inherits:
Handler
  • Object
show all
Includes:
Destiny
Defined in:
lib/lita/handlers/destiny.rb

Instance Method Summary collapse

Instance Method Details

#nightfall(response) ⇒ Object

Nightfall Activity Method

Calls #build_activity_message(activity) where activity would be nightfall.



37
38
39
40
41
42
43
44
45
46
# File 'lib/lita/handlers/destiny.rb', line 37

def nightfall(response)
  # Set up our client
  destiny_client = Destiny::Client.new(api_key)
  # Set attachment color
  color = "#d35400"
  # Set attachment thumb_url
  thumb_url = "http://i.imgur.com/J9oBqJK.png"
  # Build the activity message with nightfall info
  build_activity_message(destiny_client.nightfall, response, color, thumb_url)
end

#poe_32(response) ⇒ Object



75
76
77
# File 'lib/lita/handlers/destiny.rb', line 75

def poe_32(response)
  build_poe_message(32, response)
end

#poe_34(response) ⇒ Object



79
80
81
# File 'lib/lita/handlers/destiny.rb', line 79

def poe_34(response)
  build_poe_message(34, response)
end

#poe_35(response) ⇒ Object



83
84
85
# File 'lib/lita/handlers/destiny.rb', line 83

def poe_35(response)
  build_poe_message(35, response)
end

#weekly(response) ⇒ Object

Weekly Strike Activity Method

Calls #build_activity_message(activity) where activity would be the weekly strike.



53
54
55
56
57
58
59
60
61
62
# File 'lib/lita/handlers/destiny.rb', line 53

def weekly(response)
  # Set up our client
  destiny_client = Destiny::Client.new(api_key)
  # Set attachment color
  color = "#f39c12"
  # Set attachment thumb_url
  thumb_url = "http://i.imgur.com/HhXoUCX.png"
  # Build the activity message with weekly info
  build_activity_message(destiny_client.weekly_strike, response, color, thumb_url)
end

#xur(response) ⇒ Object

Xur Items Method

Calls #build_xur_message() Returns Xur inventory when availible.



69
70
71
72
73
# File 'lib/lita/handlers/destiny.rb', line 69

def xur(response)
  # Set attachment color
  color = "#9b59b6"
  build_xur_message(response, color)
end