lib/lita/handlers/onewheel_election_cnn.rb in lita-onewheel-election-cnn-3.0.1 vs lib/lita/handlers/onewheel_election_cnn.rb in lita-onewheel-election-cnn-3.0.2

- old
+ new

@@ -6,13 +6,21 @@ route /^e[rl]ection$/i, :election, command: true, help: {'election' => 'Display the current election results.'} + route /^e$/i, + :election, + command: true + route /^e[rl]ection\s+(.*)$/i, :election_by_state, command: true, help: {'election AB' => 'Display the current election results in Alabama.'} + + route /^e\s+(.*)$/i, + :election_by_state, + command: true def election(response) Lita.logger.debug 'Getting election data' results = JSON.parse(RestClient.get('http://data.cnn.com/ELECTION/2016/full/P.full.json'))