Skip to content

Commit

Permalink
feat: make webhook adapter explicit
Browse files Browse the repository at this point in the history
BREAKING: drop `webhookCallback(bot)` and prefer `webhookCallback(bot, "oak")`

Closes #694
  • Loading branch information
KnorpelSenf committed Dec 16, 2024
1 parent 58663d5 commit 1ef6dff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/convenience/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { type Bot } from "../bot.ts";
import { type Context } from "../context.ts";
import { type WebhookReplyEnvelope } from "../core/client.ts";
import { createDebug, defaultAdapter } from "../platform.deno.ts";
import { createDebug } from "../platform.deno.ts";
import { type Update } from "../types.ts";
import {
adapters as nativeAdapters,
Expand Down Expand Up @@ -83,7 +83,7 @@ export function webhookCallback<
: NonNullable<ReturnType<ResolveName<A>>["handlerReturn"]>;
export function webhookCallback<C extends Context = Context>(
bot: Bot<C>,
adapter: FrameworkAdapter | AdapterNames = defaultAdapter,
adapter: FrameworkAdapter | AdapterNames,
onTimeout?:
| WebhookOptions
| WebhookOptions["onTimeout"],
Expand Down
3 changes: 0 additions & 3 deletions src/platform.deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ export const itrToStream = (itr: AsyncIterable<Uint8Array>) =>

// === Base configuration for `fetch` calls
export const baseFetchConfig = (_apiRoot: string) => ({});

// === Default webhook adapter
export const defaultAdapter = "oak";

0 comments on commit 1ef6dff

Please sign in to comment.