Added methods to quickly reply to a message with Markdown or HTML#827
Added methods to quickly reply to a message with Markdown or HTML#827
Conversation
Codecov Report
@@ Coverage Diff @@
## master #827 +/- ##
==========================================
- Coverage 91.83% 91.67% -0.16%
==========================================
Files 103 103
Lines 4052 4061 +9
Branches 639 639
==========================================
+ Hits 3721 3723 +2
- Misses 193 197 +4
- Partials 138 141 +3
|
|
I edited the docstring and merged master. But it's still missing tests for these new methods. |
Eldinnie
left a comment
There was a problem hiding this comment.
But it's still missing tests for these new methods.
Please add using monkeypatch. See test_message::test_reply_text for example
|
@JosXa what is the status for this? |
|
Tests added as discussed |
|
Sorry, I keep committing files from other branches... Fixed now. |
Eldinnie
left a comment
There was a problem hiding this comment.
Some small docstring improvements and please restore the dict in test_message to the state it was.
Other than that it looks good to me.
telegram/message.py
Outdated
| def reply_markdown(self, *args, **kwargs): | ||
| """Shortcut for:: | ||
|
|
||
| bot.sendMessage(update.message.chat_id, parse_mode=ParseMode.MARKDOWN, *args, **kwargs) |
There was a problem hiding this comment.
Please use the snake_case names in docs. (send_message)
telegram/message.py
Outdated
| def reply_html(self, *args, **kwargs): | ||
| """Shortcut for:: | ||
|
|
||
| bot.sendMessage(update.message.chat_id, parse_mode=ParseMode.HTML, *args, **kwargs) |
tests/test_message.py
Outdated
| {'forward_from_chat': Chat(-23, 'channel'), | ||
| 'forward_from_message_id': 101, | ||
| 'forward_date': datetime.now()}, | ||
| { |
There was a problem hiding this comment.
Please reset the dict to the way it was.
# Conflicts: # telegram/utils/helpers.py
|
The code itself LGTM. However, I think it's over-engineering and only bloats the code. Though if the other maintainers find it suitable for ptb, I won't object. |
|
@jh0ker thinks it a good idea to have this in the library. merging. |
I had problems mergin urllib3, so this PR closes #725.
@Eldinnie Indentation adjusted as per your request.
Tests are probably gonna have to wait until pytest stops messing up my workflow...