Skip to content

Commit

Permalink
fix: handle abort signal for methods without payload (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
KnorpelSenf authored Nov 13, 2024
1 parent 1fb516e commit bcbdd4d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,14 @@ export function createRawApi<R extends RawApi>(
get(_, m: Methods<R> | "toJSON") {
return m === "toJSON"
? "__internal"
// Methods with zero parameters are called without any payload,
// so we have to manually inject an empty payload.
: m === "getMe" ||
m === "getWebhookInfo" ||
m === "getForumTopicIconStickers" ||
m === "logOut" ||
m === "close"
? client.callApi.bind(client, m, {} as Payload<typeof m, R>)
: client.callApi.bind(client, m);
},
...proxyMethods,
Expand Down

0 comments on commit bcbdd4d

Please sign in to comment.