Skip to content

Commit

Permalink
feat: add gateway events payload for super reactions (#878)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateo-tem committed May 23, 2024
1 parent 79d9875 commit 16a6a46
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 4 deletions.
15 changes: 14 additions & 1 deletion deno/gateway/v10.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import type {
APIEntitlement,
ChannelType,
} from '../payloads/v10/mod.ts';
import type { ReactionType } from '../rest/v10/mod.ts';
import type { Nullable } from '../utils/internals.ts';

export * from './common.ts';
Expand Down Expand Up @@ -1486,7 +1487,7 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
*/
export type GatewayMessageReactionRemoveDispatch = ReactionData<
GatewayDispatchEvents.MessageReactionRemove,
'member' | 'message_author_id'
'burst_colors' | 'member' | 'message_author_id'
>;

/**
Expand Down Expand Up @@ -2165,6 +2166,18 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
/**
* True if this is a super-reaction
*/
burst: boolean;
/**
* Colors used for super-reaction animation in "#rrggbb" format
*/
burst_colors: string[];
/**
* The type of reaction
*/
type: ReactionType;
},
O
>
Expand Down
16 changes: 15 additions & 1 deletion deno/gateway/v9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import type {
APIAuditLogEntry,
ChannelType,
} from '../payloads/v9/mod.ts';
import type { ReactionType } from '../rest/v9/mod.ts';
import type { Nullable } from '../utils/internals.ts';
import type { APIEntitlement } from '../v10.ts';

Expand Down Expand Up @@ -88,6 +89,7 @@ export enum GatewayOpcodes {
*/
Hello,
/**
* Re
* Sent in response to receiving a heartbeat to acknowledge that it has been received
*/
HeartbeatAck,
Expand Down Expand Up @@ -1485,7 +1487,7 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
*/
export type GatewayMessageReactionRemoveDispatch = ReactionData<
GatewayDispatchEvents.MessageReactionRemove,
'member' | 'message_author_id'
'burst_colors' | 'member' | 'message_author_id'
>;

/**
Expand Down Expand Up @@ -2164,6 +2166,18 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
/**
* True if this is a super-reaction
*/
burst: boolean;
/**
* Colors used for super-reaction animation in "#rrggbb" format
*/
burst_colors?: string[];
/**
* The type of reaction
*/
type: ReactionType;
},
O
>
Expand Down
15 changes: 14 additions & 1 deletion gateway/v10.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import type {
APIEntitlement,
ChannelType,
} from '../payloads/v10/index';
import type { ReactionType } from '../rest/v10/index';
import type { Nullable } from '../utils/internals';

export * from './common';
Expand Down Expand Up @@ -1486,7 +1487,7 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
*/
export type GatewayMessageReactionRemoveDispatch = ReactionData<
GatewayDispatchEvents.MessageReactionRemove,
'member' | 'message_author_id'
'burst_colors' | 'member' | 'message_author_id'
>;

/**
Expand Down Expand Up @@ -2165,6 +2166,18 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
/**
* True if this is a super-reaction
*/
burst: boolean;
/**
* Colors used for super-reaction animation in "#rrggbb" format
*/
burst_colors: string[];
/**
* The type of reaction
*/
type: ReactionType;
},
O
>
Expand Down
16 changes: 15 additions & 1 deletion gateway/v9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import type {
APIAuditLogEntry,
ChannelType,
} from '../payloads/v9/index';
import type { ReactionType } from '../rest/v9/index';
import type { Nullable } from '../utils/internals';
import type { APIEntitlement } from '../v10';

Expand Down Expand Up @@ -88,6 +89,7 @@ export enum GatewayOpcodes {
*/
Hello,
/**
* Re
* Sent in response to receiving a heartbeat to acknowledge that it has been received
*/
HeartbeatAck,
Expand Down Expand Up @@ -1485,7 +1487,7 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
*/
export type GatewayMessageReactionRemoveDispatch = ReactionData<
GatewayDispatchEvents.MessageReactionRemove,
'member' | 'message_author_id'
'burst_colors' | 'member' | 'message_author_id'
>;

/**
Expand Down Expand Up @@ -2164,6 +2166,18 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
/**
* True if this is a super-reaction
*/
burst: boolean;
/**
* Colors used for super-reaction animation in "#rrggbb" format
*/
burst_colors?: string[];
/**
* The type of reaction
*/
type: ReactionType;
},
O
>
Expand Down

0 comments on commit 16a6a46

Please sign in to comment.