From 50d4e6b989dd1966de9aa169ce043b7c7204d4b3 Mon Sep 17 00:00:00 2001 From: Stephen Yeargin Date: Sun, 2 Oct 2022 20:57:52 -0500 Subject: [PATCH] Fix bug --- src/nextbus.coffee | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/nextbus.coffee b/src/nextbus.coffee index 1545b60..30d5aaa 100644 --- a/src/nextbus.coffee +++ b/src/nextbus.coffee @@ -15,17 +15,17 @@ # Author: # stephenyeargin -moment = require('moment') -AsciiTable = require('ascii-table') -baseURL = process.env.HUBOT_NEXTBUS_BASE_URL || 'https://gtfs.transitnownash.org' -latlon = process.env.HUBOT_NEXTBUS_LAT_LON -defaultStopId = process.env.HUBOT_NEXTBUS_STOP_ID - module.exports = (robot) -> + moment = require('moment') + AsciiTable = require('ascii-table') + baseURL = process.env.HUBOT_NEXTBUS_BASE_URL || 'https://gtfs.transitnownash.org' + latlon = process.env.HUBOT_NEXTBUS_LAT_LON + defaultStopId = process.env.HUBOT_NEXTBUS_STOP_ID + # query the default stop ID or location's closest bus stop robot.respond /(?:bus|nextbus)(?: me)?$/i, (msg) -> if defaultStopId - queryStopById stop_id, msg + queryStopById defaultStopId, msg return getAPIResponse "stops/near/#{latlon}/1000.json?per_page=5", msg, (stops) ->