/
ChatSubInfo.ts
201 lines (170 loc) · 3.95 KB
/
ChatSubInfo.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
/**
* Information about the original gift of a subscription.
*/
export interface ChatSubOriginalGiftInfo {
/**
* Whether the gift was anonymous.
*/
anonymous: boolean;
/**
* The ID of the user that originally gifted the subscription. Only set if the gift was not anonymous.
*/
userId?: string;
/**
* The name of the user that originally gifted the subscription. Only set if the gift was not anonymous.
*/
userName?: string;
/**
* The display name of the user that originally gifted the subscription. Only set if the gift was not anonymous.
*/
userDisplayName?: string;
/**
* The duration of the gift, in months.
*/
duration: number;
/**
* The number of the month out of the total gift duration that was just redeemed.
*/
redeemedMonth: number;
}
/**
* Information about a subscription.
*/
export interface ChatSubInfo {
/**
* The user ID of the subscribing user.
*/
userId: string;
/**
* The display name of the subscribing user.
*/
displayName: string;
/**
* The plan ID of the subscription.
*
* Tier 1, 2, 3 are '1000', '2000', '3000' respectively, and a Twitch Prime subscription is called 'Prime'.
*/
plan: string;
/**
* The plan name of the subscription.
*/
planName: string;
/**
* Whether the subscription was "paid" for with Twitch Prime.
*/
isPrime: boolean;
/**
* The number of total months of subscriptions for the channel.
*/
months: number;
/**
* The number of consecutive months of subscriptions for the channel.
*
* Will not be sent if the user resubscribing does not choose to.
*/
streak?: number;
/**
* The message that was sent with the subscription.
*/
message?: string;
/**
* The info about the original gift of the subscription, when renewing a multi-month gift.
*/
originalGiftInfo?: ChatSubOriginalGiftInfo;
}
/**
* Information about a subscription that was gifted.
*
* @inheritDoc
*/
export interface ChatSubGiftInfo extends ChatSubInfo {
/**
* The name of the user that gifted the subscription.
*/
gifter?: string;
/**
* The user ID of the user that gifted the subscription.
*/
gifterUserId?: string;
/**
* The display name of the user that gifted the subscription.
*/
gifterDisplayName?: string;
/**
* The number of subscriptions the gifting user has already gifted in total.
*/
gifterGiftCount?: number;
/**
* The duration of the gifted subscription, in months.
*/
giftDuration: number;
}
/**
* Information about a subscription that was upgraded from a Prime subscription.
*/
export interface ChatSubUpgradeInfo {
/**
* The user ID of the subscribing user.
*/
userId: string;
/**
* The display name of the subscribing user.
*/
displayName: string;
/**
* The plan ID of the subscription.
*
* Tier 1, 2, 3 are '1000', '2000', '3000' respectively, and a Twitch Prime subscription is called 'Prime'.
*/
plan: string;
}
/**
* Information about a subscription that was upgraded from a gift.
*/
export interface ChatSubGiftUpgradeInfo {
/**
* The user ID of the subscribing user.
*/
userId: string;
/**
* The display name of the subscribing user.
*/
displayName: string;
/**
* The name of the user that gifted the original subscription.
*/
gifter: string;
/**
* The display name of the user that gifted the original subscription.
*/
gifterDisplayName: string;
}
/**
* Information about a subsription extension.
*/
export interface ChatSubExtendInfo {
/**
* The user ID of the subscribing user.
*/
userId: string;
/**
* The display name of the subscribing user.
*/
displayName: string;
/**
* The plan ID of the subscription.
*
* Tier 1, 2, 3 are '1000', '2000', '3000' respectively, and a Twitch Prime subscription is called 'Prime'.
*/
plan: string;
/**
* The number of total months of subscriptions for the channel.
*/
months: number;
/**
* The month when the subscription will now end.
*
* 1 corresponds to January, and 12 means December.
*/
endMonth: number;
}