Skip to content

Commit 12953d5

Browse files
authored
Merge pull request #8 from TheStaticMage/kicks-gifted
Add Kicks gifted payload
2 parents eaa8da1 + 91d8645 commit 12953d5

File tree

1 file changed

+38
-6
lines changed

1 file changed

+38
-6
lines changed

payloads/v1/webhooks.ts

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import type {Emote} from './emote';
22

3-
export interface WebhookUser {
3+
/**
4+
* Represents a user in the context of most of Kick's webhook events,
5+
* specifically those that include the is_anonymous field.
6+
*
7+
* @see WebhookBaseUser
8+
*/
9+
export interface WebhookUser extends WebhookBaseUser {
410
is_anonymous: boolean;
5-
user_id?: number;
6-
username?: string;
7-
is_verified?: boolean;
8-
profile_picture?: string;
9-
channel_slug?: string;
1011
}
1112

1213
export interface WebhookBadge {
@@ -15,6 +16,14 @@ export interface WebhookBadge {
1516
count?: number;
1617
}
1718

19+
export interface WebhookBaseUser {
20+
user_id?: number;
21+
username?: string;
22+
is_verified?: boolean;
23+
profile_picture?: string;
24+
channel_slug?: string;
25+
}
26+
1827
export interface WebhookIdentity {
1928
username_color: string;
2029
badges: WebhookBadge[];
@@ -24,6 +33,14 @@ export interface WebhookUserWithIdentity extends WebhookUser {
2433
identity: WebhookIdentity;
2534
}
2635

36+
/**
37+
* Represents a user in the context of a "kicks gifted" webhook event. Kick's
38+
* API does not provide the is_anonymous field that other webhook events have.
39+
*
40+
* @see WebhookBaseUser
41+
*/
42+
export interface KicksGiftedWebhookUser extends WebhookBaseUser {}
43+
2744
export interface WebhookRepliesTo {
2845
message_id: string;
2946
content: string;
@@ -103,3 +120,18 @@ export interface ModerationBannedEvent {
103120
banned_user: WebhookUser;
104121
metadata: ModerationBannedEventMetadata;
105122
}
123+
124+
export interface KicksGiftedEvent {
125+
eventType: 'kicks.gifted';
126+
eventVersion: '1';
127+
broadcaster: KicksGiftedWebhookUser;
128+
sender: KicksGiftedWebhookUser;
129+
gift: {
130+
amount: number;
131+
name: string;
132+
type: string;
133+
tier: string;
134+
message: string;
135+
};
136+
created_at: string;
137+
}

0 commit comments

Comments
 (0)