lib/lita/handlers/onewheel_duckduckgo.rb in lita-onewheel-duckduckgo-0.0.4 vs lib/lita/handlers/onewheel_duckduckgo.rb in lita-onewheel-duckduckgo-0.0.5
- old
+ new
@@ -11,14 +11,13 @@
def search(response)
query = response.matches[0][0]
Lita.logger.debug "Querying for #{query}"
result = get_result(query)
Lita.logger.debug "Result: #{result}"
- reply = 'DuckDuckGo Result: '
if result['Abstract'].empty?
- reply += result['AbstractURL']
+ reply = result['AbstractURL']
else
- reply += result['Abstract'][0..250]
+ reply = result['Abstract'][0..250]
end
Lita.logger.debug "Reply: #{reply}"
response.reply reply
end