Skip to content

Commit

Permalink
fix(NonDispatchPayload): t & s fields are always null on non-disp…
Browse files Browse the repository at this point in the history
…atch payloads (#259)
  • Loading branch information
Marvin Witt authored Dec 8, 2021
1 parent c67d426 commit 315ce35
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion deno/gateway/v8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,10 @@ interface BasePayload {
t?: string;
}

type NonDispatchPayload = Omit<BasePayload, 't'>;
type NonDispatchPayload = Omit<BasePayload, 't' | 's'> & {
t: null;
s: null;
};

interface DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends BasePayload {
op: GatewayOpcodes.Dispatch;
Expand Down
5 changes: 4 additions & 1 deletion deno/gateway/v9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,10 @@ interface BasePayload {
t?: string;
}

type NonDispatchPayload = Omit<BasePayload, 't'>;
type NonDispatchPayload = Omit<BasePayload, 't' | 's'> & {
t: null;
s: null;
};

interface DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends BasePayload {
op: GatewayOpcodes.Dispatch;
Expand Down
5 changes: 4 additions & 1 deletion gateway/v8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,10 @@ interface BasePayload {
t?: string;
}

type NonDispatchPayload = Omit<BasePayload, 't'>;
type NonDispatchPayload = Omit<BasePayload, 't' | 's'> & {
t: null;
s: null;
};

interface DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends BasePayload {
op: GatewayOpcodes.Dispatch;
Expand Down
5 changes: 4 additions & 1 deletion gateway/v9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,10 @@ interface BasePayload {
t?: string;
}

type NonDispatchPayload = Omit<BasePayload, 't'>;
type NonDispatchPayload = Omit<BasePayload, 't' | 's'> & {
t: null;
s: null;
};

interface DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends BasePayload {
op: GatewayOpcodes.Dispatch;
Expand Down

0 comments on commit 315ce35

Please sign in to comment.