diff options
| author | 2016-11-01 21:18:43 +0000 | |
|---|---|---|
| committer | 2016-11-01 21:19:03 +0000 | |
| commit | b92abaf20d17782c9ee46f0b17ffe670a6f04df1 (patch) | |
| tree | 4e6f584b7b96552e39b61610844b7c5104ab0688 | |
| parent | Force CRS to upper (Darwin doesn't like lowercase CRS codes) (diff) | |
Start of tflstop command
| -rw-r--r-- | modules/tfl.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/tfl.py b/modules/tfl.py index a62bbcae..e3c3a692 100644 --- a/modules/tfl.py +++ b/modules/tfl.py @@ -34,6 +34,10 @@ class Module(object): ).hook(self.vehicle, min_args=1, help="Get information for a given vehicle", usage="<ID>") + bot.events.on("received").on("command").on("tflstop" + ).hook(self.stop, min_args=1, + help="Get information for a given stop", + usage="<stop_id>") def vehicle_span(self, arrival_time, human=True): vehicle_due_iso8601 = arrival_time @@ -201,3 +205,9 @@ class Module(object): vehicle["vehicleId"], vehicle["lineName"], vehicle["destinationName"], vehicle["currentLocation"], vehicle["stationName"], vehicle["naptanId"], arrival_time, platform)) + def stop(self, event): + app_id = self.bot.config["tfl-api-id"] + app_key = self.bot.config["tfl-api-key"] + + stop = Utils.get_url(URL_STOP % vehicle_id, get_params={ + "app_id": app_id, "app_key": app_key}, json=True) |
