From 51a52e2b0e54031cce5876f54d1d48c268b5441c Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 26 Sep 2018 18:27:17 +0100 Subject: Switch to using @Utils.hook and docstrings for event hooks --- modules/weather.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'modules/weather.py') diff --git a/modules/weather.py b/modules/weather.py index e79d1ad8..f16b62b7 100644 --- a/modules/weather.py +++ b/modules/weather.py @@ -7,11 +7,12 @@ URL_WEATHER = "http://api.openweathermap.org/data/2.5/weather" class Module(object): def __init__(self, bot, events, exports): self.bot = bot - events.on("received.command.weather").hook(self.weather, min_args=1, - help="Get current weather data for a provided location", - usage="") + @Utils.hook("received.command.weather", min_args=1, usage="") def weather(self, event): + """ + Get current weather data for a provided location + """ api_key = self.bot.config["openweathermap-api-key"] page = Utils.get_url(URL_WEATHER, get_params={ "q": event["args"], "units": "metric", -- cgit v1.3.1-10-gc9f91