From a07fbeae0fcf69a250e8a559dbe2c1c36b56c7dd Mon Sep 17 00:00:00 2001 From: Humorous Baby <44451911+HumorBaby@users.noreply.github.com> Date: Fri, 26 Oct 2018 23:46:45 -0400 Subject: [PATCH] Fix nickname_commands loading that got lost along the way. The for loop that adds nickname_commands to the func.rules got lost along the way to prevent duplicate regexp rules for a given func. --- sopel/loader.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sopel/loader.py b/sopel/loader.py index 320ea23c3d..906e78b59e 100644 --- a/sopel/loader.py +++ b/sopel/loader.py @@ -169,6 +169,11 @@ def clean_callable(func, config): # See issue 1056 # TODO: Maybe func.rule should be a set() instead? func.rule.append(regexp) + for command in getattr(func, 'nickname_commands', []): + regexp = get_nickname_command_regexp(nick, command, alias_nicks) + if regexp not in func.rule: + # See for-loop immediately above this. + func.rule.append(regexp) if hasattr(func, 'example'): example = func.example[0]["example"] example = example.replace('$nickname', nick)