From 68298bbccf715fb4d8c82e45a74c309a74d0c77e Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 15 Jul 2018 15:15:52 +0100 Subject: Added EventHook.call_for_result to get a result or default from an event --- modules/bitly.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/bitly.py') diff --git a/modules/bitly.py b/modules/bitly.py index ac7835a1..f31ca347 100644 --- a/modules/bitly.py +++ b/modules/bitly.py @@ -25,8 +25,8 @@ class Module(object): return data["data"]["url"] def shorten(self, event): - link = self.bot.events.on("get").on("shortlink").call( - url=event["args"])[0] + link = self.bot.events.on("get").on("shortlink" + ).call_for_result(url=event["args"]) if link: event["stdout"].write("Short URL: %s" % link) else: -- cgit v1.3.1-10-gc9f91