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
Add ctx.send* methods and optional useNewReplies from telegraf/future #1623
Conversation
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.
The history is a little messy already, I suggest merge-squashing or rebasing before merging.
an optional middleware,
useOldReplies
, to replace them with the old methods may be added.
Just throw away the old behavior, that's the point of a major release.
I will review this in a few days, my time is currently a bit limited. Please don't wait for me if prefer to merge before I get to this. |
I see no reason to rush this |
2c67fb0
to
897275c
Compare
I have rebased, but prefer not to squash history. Rather than treat git as a changelog, I prefer to treat it as a devlog.
Okay, I've updated the PR description to reflect this
No pressure; I might merge after some more testing to make sure nothing is breaking. If you get time meanwhile, appreciate a review. |
9c018b8
to
da82c1f
Compare
da82c1f
to
c9b8d92
Compare
2356817
to
68f5f03
Compare
Why not merge this into v4 right now? |
Also: newReplies from telegraf/future to enable actual replies Signed-off-by: Muthu Kumar <muthukumar@thefeathers.in>
Signed-off-by: Muthu Kumar <muthukumar@thefeathers.in>
68f5f03
to
78fc0bc
Compare
It has been a long-confusing feature of Telegraf that
ctx.reply
doesn't actually reply, but sends a message in the same chat. We now plan to fix it. This PR introducesctx.sendMessage
,ctx.sendPhoto
, etc., that reflect the upstream API, but implicitly send a message in the same chat, more consistently with the other Context methods. This is the current behaviour of thectx.reply
methods.This PR also introduces the new reply mode, which is optionally enabled using the
useNewReplies
middleware. Demonstration:This causes
ctx.reply
,ctx.replyWithPhoto
, and the like to actually reply to the message in current context. If a message is not available, it will simply send a regular message.A future minor release of telegraf will deprecate the current
ctx.reply*
methods in favour of the new ones, causing their usage to log warnings, prompting users to enableuseNewReplies
. v5 will completely replace the behaviour ofctx.reply
with the new reply methods,and an optional middleware,useOldReplies
, to replace them with the old methods may be added.