Skip to content

Commit

Permalink
Fix stripping of <bot> tag in reply_regexp
Browse files Browse the repository at this point in the history
The <bot> tag was being passed through `utils.strip_nasties()` which was
removing all Unicode symbols even in UTF-8 mode. Instead, pass the bot
variables through `format_message()` to give them the same treatment as
normal messages.

This fixes #80 some more.
  • Loading branch information
kirsle committed Feb 10, 2017
1 parent 5c51574 commit 4c3d82a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rivescript/brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def reply_regexp(self, user, regexp):
for var in bvars:
rep = ''
if var in self.master._var:
rep = utils.strip_nasties(self.master._var[var])
rep = self.format_message(self.master._var[var])
regexp = regexp.replace('<bot {var}>'.format(var=var), rep)

# Filter in user variables.
Expand Down

0 comments on commit 4c3d82a

Please sign in to comment.