Closed chrisandrewcl closed 1 year ago
Absolutely! I'm looking forward to your contributions :)
I believe @amberlionk to be the one who contributed the AWS adapter in #62. In case you have any questions about the implementation, I'm sure we are both open to answer them!
Sorry for the late reply btw, I was a little busy recently
@all-contributors add @chrisandrewcl for bug
@KnorpelSenf
I've put up a pull request to add @chrisandrewcl! :tada:
@KnorpelSenf I've submitted a PR for review, addressing points 1 and 2.
Regarding point 3, is there any way to call an API method on "dry-run" to get only the JSON payload?
If not, and if it is something that makes sense for the framework, I can submit a separate feature request (to be considered for a future version) and this issue can be hopefully closed with PR#418.
Regarding point 3, is there any way to call an API method on "dry-run" to get only the JSON payload?
I'm not 100 % sure I understand what you mean, but I believe https://grammy.dev/advanced/transformers.html to be the solution.
I've started experimenting with grammyjs and encountered a few issues while trying to use the aws-lambda adapter for the
webhookCallback
:webhookCallback
returns an async function, which causes the lambda to be called without the callback, resulting in "callback is not a function" errors.Content-Type: application/json
.I was able to work around issues 1 and 2 by setting the header directly and wrapping the handler with a promise:
If my understanding is correct, the framework could be improved by:
webhookCallback
work would spill in a lot of other places and could be too much to ask, but it would be great to have more flexibility by having something asconst reply = ctx.reply(/* ... */, { returnJsonPayload: true })
(disregardingcanUseWebhookReply
) so that we can explicitly set a response after we have done everything else. Is something like this possible in the current version? Without it, I am considering "leaking" the function given tocanUseWebhookReply
so that we can control when it should return true later on each request, but it seems messy. I hope there is a better way.1 and 2 look like good "first issues", so I would like to contribute with a PR if that's ok.