-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add support for processing language parameter in message entities #2466
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
Conversation
|
Looks fine. Did you perform tests of this update? |
|
I updated the test file with some optimisations. For the issues mentioned above, environment variables are used directly. All tests now pass. Also, I added tests for the |
You need to pass YOUR bot token there. |
Not absolutely correct due to TOKEN var may not exist if nothing in environment, but better then ''... |
I saw environment variables for token, but some tests used them and some didn't, so I was confused. I updated to use the same environment variables for all tests so we don't have to manually edit the test files. |
|
func is designed wrong. Otherwise symbols like < and > will break the markdown. |
Thanks for pointing out the problem. I've modified the code along the lines of your idea and added a test for special characters. |
|
Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
tests/test_telebot.py:47
- Ensure that TOKEN is defined and imported in this test file to prevent an undefined variable error.
tb = telebot.TeleBot(TOKEN)
@pplulee It was just for test ) |


Description
Add support for processing code language parameter in
<pre>tag under message entitiesDescribe your tests
How did you test your change?
Python version: 3.12
OS: Windows 11
Send a message containing a code block to the bot, then see the result of the parsed HTML code.
Checklist: