-
I have a suggestion Something like this bot.telegram.use(async (method,data,next)=>{
let result = await next(method,data);
}); This is useful in some cases:
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
Currently, this can be safely achieved by replacing |
Beta Was this translation helpful? Give feedback.
-
Yes i know and I'm using this method |
Beta Was this translation helpful? Give feedback.
-
This will be a significant internal change (I'd expect it to ship in We will need a proposal, so here's mine. To keep the discussion manageable, please post any concerns about my proposal as a reply to this, and any alternatives as a standalone comment, so it can be discussed separately.
interface ApiClientInterface {
callApi: <M extends keyof Telegram>(
method: M,
payload: Opts<M>,
{ signal, response }: ApiClient.CallApiOptions = {}
) => Promise<ReturnType<Telegram[M]>>
}
type Interceptor = (client: ApiClientInterface) => ApiClientInterface
It'd be great if some way to access response headers ( Breaking: Breaking: that breaks This decoupling would allow to write
|
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
In case anyone is still interested in this, an alternative package that I created (called grammY) features exactly what this discussion is asking for. |
Beta Was this translation helpful? Give feedback.
#1704