Skip to content

Commit

Permalink
Fix nickname_commands loading that got lost along the way.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
HumorBaby committed Oct 28, 2018
1 parent b8fb797 commit a07fbea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sopel/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a07fbea

Please sign in to comment.