Skip to content

Commit 00dbe41

Browse files
fix(types): Generic Middleware
1 parent ced5fd4 commit 00dbe41

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "discord.https",
3-
"version": "3.0.1",
3+
"version": "3.0.2",
44
"description": "Discord.https is a modular library for building and managing Discord HTTP interactions with the Discord API. It provides tools for routing and managing interaction efficiently.",
55
"main": "./dist/index.js",
66
"type": "module",

src/interactionRouter/internal.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ export interface Context {
7878
* A middleware function executed during an HTTP interaction lifecycle.
7979
*
8080
* @typeParam T - The specific interaction type handled by the middleware.
81-
* Defaults to {@link Context.resolvedInteraction | Context["resolvedInteraction"]}.
81+
* Defaults to {@link DiscordHttpsInteraction}.
8282
*
8383
* @param interaction - The resolved interaction for this request.
8484
* @param client - A read-only {@link Client} instance.
8585
* @param flush - A function you can call to immediately stop further middleware execution and end the request.
8686
*
8787
*/
88-
export type GenericMiddleware<T = Context["resolvedInteraction"]> = (
88+
export type GenericMiddleware<T = DiscordHttpsInteraction> = (
8989
/**
9090
* The resolved interaction for this request.
9191
*/
@@ -103,9 +103,7 @@ export type GenericMiddleware<T = Context["resolvedInteraction"]> = (
103103
flush: () => never
104104
) => Promise<void>;
105105

106-
export type GeneralMiddleware = GenericMiddleware<
107-
DiscordHttpsInteraction | DiscordHttpsAPIInteraction
108-
>;
106+
export type GeneralMiddleware = GenericMiddleware;
109107

110108
export type CommandMiddleware = GenericMiddleware<ChatInputCommandInteraction>;
111109

0 commit comments

Comments
 (0)