From 376825ea96099efc0f5e890370a417db1902df1a Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 10 Oct 2018 10:42:41 +0100 Subject: Mark command hooks that are aliases ('g' vs 'google') --- modules/quotes.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'modules/quotes.py') diff --git a/modules/quotes.py b/modules/quotes.py index 8ee1f561..ab3e4d18 100644 --- a/modules/quotes.py +++ b/modules/quotes.py @@ -7,7 +7,8 @@ class Module(ModuleManager.BaseModule): return [part.strip() for part in s.split("=", 1)] return None, None - @utils.hook("received.command.quoteadd|qadd", min_args=1) + @utils.hook("received.command.qadd", alias_of="quoteadd") + @utils.hook("received.command.quoteadd", min_args=1) def quote_add(self, event): """ :help: Add a quote to a category @@ -23,7 +24,8 @@ class Module(ModuleManager.BaseModule): else: event["stderr"].write("Please provide a category AND quote") - @utils.hook("received.command.quoteget|qget", min_args=1) + @utils.hook("received.command.qget", alias_of="quoteget") + @utils.hook("received.command.quoteget", min_args=1) def quote_get(self, event): """ :help: Get a quote from a ccategory @@ -46,7 +48,8 @@ class Module(ModuleManager.BaseModule): event["stderr"].write("Please provide a category and a " "part of a quote to find") - @utils.hook("received.command.quotedel|qdel", min_args=1) + @utils.hook("received.command.qdel", alias_of="quotedel") + @utils.hook("received.command.quotedel", min_args=1) def quote_del(self, event): """ :help: Delete a quote from a category @@ -71,7 +74,8 @@ class Module(ModuleManager.BaseModule): event["stderr"].write("Please provide a category and a quote " "to remove") - @utils.hook("received.command.quote|q", min_args=1) + @utils.hook("received.command.q", alias_of="quote") + @utils.hook("received.command.quote", min_args=1) def quote(self, event): """ :help: Get a random quote from a category -- cgit v1.3.1-10-gc9f91