grammyjs / grammY

The Telegram Bot Framework.
https://grammy.dev
MIT License
2.21k stars 110 forks source link

feat: improve support for replied-to messages #429

Closed KnorpelSenf closed 7 months ago

KnorpelSenf commented 1 year ago

Context shortcuts do not take take reply_to_message into account.

Replies are a bit of a gap in what grammY supports. This should be fixed. Here are some examples of what we'd like to do:

Let's discuss a few ideas how to tackle this.

  1. Take this pull request and apply it to everything else. This would mean that we have to introduce a lot of options everywhere.
  2. Provide a namespace ctx.replyTo which lets us test for all sorts of things, such as ctx.replyTo.message for the message object, ctx.replyTo.hasCommand("start") to check for /start commands, ctx.replyTo.entities to cover this PQ here, and so on.
  3. Provide a grammY plugin that does all of these things somehow.
  4. Maybe yet another solution?

Originally posted by @KnorpelSenf in https://github.com/grammyjs/grammY/issues/413#issuecomment-1565913241

KnorpelSenf commented 1 year ago

I'd like to go with option 3 after grammY 2.0 is released.

KnorpelSenf commented 7 months ago

I added this to #110. Closing.