Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with parenthesis and variables #80

Closed
arashsa opened this issue Feb 10, 2017 · 2 comments
Closed

Issues with parenthesis and variables #80

arashsa opened this issue Feb 10, 2017 · 2 comments
Labels

Comments

@arashsa
Copy link
Contributor

arashsa commented Feb 10, 2017

In the JS version this seems to work, but not in the Python version.

! var test = Hi there

+ hi
- <bot test>

+ get lost
% <bot test>
- why?
@arashsa
Copy link
Contributor Author

arashsa commented Feb 10, 2017

The same also applies for utf8 characters.

! var test = hæ there

+ hi
- <bot test>

+ get lost
% <bot test>
- why?

Anybody know how to fix this?

@kirsle kirsle added the bug label Feb 10, 2017
@kirsle kirsle closed this as completed in 5c51574 Feb 10, 2017
@kirsle
Copy link
Member

kirsle commented Feb 10, 2017

This should be fixed using the current master branch of this repo. I'll do a deployment to PyPI later.

5c51574

The root cause was that the <bot test> was returning a string with capital letters, so "Hi there" wasn't matching "hi there". I also fixed a similar issue with lowercasing @Redirects that I found on the Go version.

Edit: for the UTF-8 version, I fixed another bug that was causing that to fail (interestingly, the UTF-8 example worked with UTF-8 Mode disabled, and broke when enabled). 4c3d82a The <bot> tags used to be getting sent through the utils.strip_nasties() function which removed all symbols/foreign characters, so instead I send it through the same format_message() function as the user message/bot lastReply so that the UTF-8 rules apply consistently.

kirsle added a commit that referenced this issue Feb 10, 2017
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants