grammyjs / conversations

Conversational interfaces for grammY.
https://grammy.dev/plugins/conversations
MIT License
53 stars 17 forks source link

feat: run middleware from within a conversation #44

Closed KnorpelSenf closed 2 years ago

KnorpelSenf commented 2 years ago

It would be great to be able to run middleware from within a conversation.

function convo(conversation: MyConversation, ctx: MyContext) {
  await conversation.run(middleware())
}

This would run the middleware once, as soon as it is reached, regardless of whether we are inside a replay operation or not. As a result, we should be able to install grammY plugins specifically for one conversation.

This might very well combine with #42.

KnorpelSenf commented 2 years ago

Please review #47 and in turn #52.