diff options
| author | 2018-08-31 12:55:52 +0100 | |
|---|---|---|
| committer | 2018-08-31 13:44:39 +0100 | |
| commit | b7cf524e9869828ff85954cb731f7fee98bee8d9 (patch) | |
| tree | d5d887ac82f3e50f0ea295953981363c1c5e7c5a /modules/tfl.py | |
| parent | Revert "Reformat" (diff) | |
| signature | ||
Give modules event objects with "context"s, to facilitate purging all the event
hooks for a module
Diffstat (limited to 'modules/tfl.py')
| -rw-r--r-- | modules/tfl.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/tfl.py b/modules/tfl.py index 2a017f1d..72862db6 100644 --- a/modules/tfl.py +++ b/modules/tfl.py @@ -20,30 +20,30 @@ PLATFORM_TYPES = ["Northbound", "Southbound", "Eastbound", "Westbound", "Inner R class Module(object): _name = "TFL" - def __init__(self, bot): + def __init__(self, bot, events): self.bot = bot self.result_map = {} - bot.events.on("received").on("command").on("tflbus" + events.on("received").on("command").on("tflbus" ).hook(self.bus, min_args=1, help="Get bus due times for a TfL bus stop", usage="<stop_id>") - bot.events.on("received").on("command").on("tflline" + events.on("received").on("command").on("tflline" ).hook(self.line, help="Get line status for TfL underground lines", usage="<line_name>") - bot.events.on("received").on("command").on("tflsearch" + events.on("received").on("command").on("tflsearch" ).hook(self.search, min_args=1, help="Get a list of TfL stop IDs for a given name", usage="<name>") - bot.events.on("received").on("command").on("tflvehicle" + events.on("received").on("command").on("tflvehicle" ).hook(self.vehicle, min_args=1, help="Get information for a given vehicle", usage="<ID>") - bot.events.on("received").on("command").on("tflstop" + events.on("received").on("command").on("tflstop" ).hook(self.stop, min_args=1, help="Get information for a given stop", usage="<stop_id>") - bot.events.on("received").on("command").on("tflservice" + events.on("received").on("command").on("tflservice" ).hook(self.service, min_args=1, help="Get service information and arrival estimates", usage="<service index>") |
