-
Notifications
You must be signed in to change notification settings - Fork 129
Improve API flavors example #1221
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
base: main
Are you sure you want to change the base?
Conversation
|
I don't think there is any plugin that works this way. I am not sure if we should illustrate it this way. We can, however, add a code snippet that does // Install an alias so we don't have to type out `.raw`:
bot.api.someMethod = (param) => bot.api.raw.someMethod(param);and then the same inside middleware. What do you think about this? |
|
So the export type SomeContextFlavor = {
someMethod: (...) => Promise<...>
}right? |
@KnorpelSenf, could you answer this, please? |
|
@evermake that would be the API flavour, but yes, that structure is correct. For the context flavour, it needs to adjust |
|
🚀 Deployed on https://690f1bd8c66a3ecbf2d54ed4--grammy.netlify.app |
KnorpelSenf
left a comment
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.
Excellent stuff, thank you!
|
@KnorpelSenf, should I update labels somehow to make CI pass? |
|
Nope, we need to wait for translations. Once they're done (all language labels are added) the job will pass. |
See discussion at: https://t.me/grammyjs/314748