Skip to content

Commit 84192b9

Browse files
doc: improvements
1 parent ba70597 commit 84192b9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/interactionRouter/internal.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ export interface Context {
7979
*
8080
* @typeParam T - The specific interaction type handled by the middleware.
8181
* Defaults to {@link Context.resolvedInteraction | Context["resolvedInteraction"]}.
82+
*
83+
* @param interaction - The resolved interaction for this request.
84+
* @param client - A read-only {@link Client} instance.
85+
* @param flush - A function you can call to immediately stop further middleware execution and end the request.
86+
*
8287
*/
8388
export type GenericMiddleware<T = Context["resolvedInteraction"]> = (
8489
/**
@@ -88,7 +93,6 @@ export type GenericMiddleware<T = Context["resolvedInteraction"]> = (
8893

8994
/**
9095
* A read-only {@link Client} instance.
91-
* Use this to perform Discord REST API calls safely.
9296
*/
9397
client: Readonly<Client>,
9498

@@ -151,6 +155,11 @@ export type ContextMenuMiddleware =
151155
*
152156
* @typeParam T - The Discord HTTPS API interaction type.
153157
* Defaults to {@link DiscordHttpsAPIInteraction}.
158+
*
159+
* @param interaction - The raw Discord HTTPS API interaction.
160+
* @param client - A read-only {@link Client} instance.
161+
* @param flush - A function you can call to immediately stop further middleware execution and end the request. Ends the middleware chain immediately. Calling `flush()` stops further middleware.
162+
* @param res - `res` should be provided to unknown middlewares only, as {@link UnknownMiddleware} is meant to be used when the library does not yet cover a specific interaction.
154163
*/
155164
export type UnknownMiddleware<T = DiscordHttpsAPIInteraction> = (
156165
/**

0 commit comments

Comments
 (0)