-
Notifications
You must be signed in to change notification settings - Fork 0
/
ws_models.go
235 lines (222 loc) · 8.43 KB
/
ws_models.go
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
package gotau
import "time"
// Event is the common parts of every event coming from TAU
type Event struct {
ID string `json:"id"`
EventID string `json:"event_id"`
EventType string `json:"event_type"`
EventSource string `json:"event_source"`
Created Time `json:"created"`
Origin string `json:"origin"`
}
// FollowMsg is a message representing a follow event that TAU sends
type FollowMsg struct {
*Event
EventData struct {
UserName string `json:"user_name"`
UserID string `json:"user_id"`
UserLogin string `json:"user_login"`
BroadcasterID string `json:"broadcaster_user_id"`
BroadcasterName string `json:"broadcaster_user_name"`
BroadcasterLogin string `json:"broadcaster_user_login"`
} `json:"event_data"`
}
// StreamUpdateMsg is a message that represents a stream update event that TAU sends
type StreamUpdateMsg struct {
*Event
EventData struct {
Title string `json:"title"`
Language string `json:"language"`
IsMature bool `json:"is_mature"`
CategoryID int `json:"category_id"`
CategoryName string `json:"category_name"`
BroadcasterID string `json:"broadcaster_user_id"`
BroadcasterName string `json:"broadcaster_user_name"`
BroadcasterLogin string `json:"broadcaster_user_login"`
} `json:"event_data"`
}
// CheerMsg is a message that represents a cheer event that TAU sends
type CheerMsg struct {
*Event
EventData struct {
IsAnonymous bool `json:"is_anonymous"`
UserID string `json:"user_id"`
UserName string `json:"user_name"`
UserLogin string `json:"user_login"`
BroadcasterID string `json:"broadcaster_user_id"`
BroadcasterName string `json:"broadcaster_user_name"`
BroadcasterLogin string `json:"broadcaster_user_login"`
Bits int `json:"bits"`
Message string `json:"message"`
} `json:"event_data"`
}
// RaidMsg is a message that represents a raid event that TAU sends
type RaidMsg struct {
*Event
EventData struct {
FromBroadcasterName string `json:"from_broadcaster_user_name"`
FromBroadcasterID string `json:"from_broadcaster_user_id"`
FromBroadcasterLogin string `json:"from_broadcaster_user_login"`
ToBroadcasterName string `json:"to_broadcaster_user_name"`
ToBroadcasterID string `json:"to_broadcaster_user_id"`
ToBroadcasterLogin string `json:"to_broadcaster_user_login"`
Viewers int `json:"viewers"`
} `json:"event_data"`
}
// SubscriptionMsg is a message that represents a subscription event that TAU sends
type SubscriptionMsg struct {
*Event
EventData struct {
Type string `json:"type"`
Data struct {
Topic string `json:"topic"`
Message struct {
BenefitEndMonth int `json:"benefit_end_month"`
UserName string `json:"user_name"`
DisplayName string `json:"display_name"`
ChannelName string `json:"channel_name"`
UserID string `json:"user_id"`
ChannelID string `json:"channel_id"`
Time time.Time `json:"time"`
SubPlan string `json:"sub_plan"`
SubPlanName string `json:"sub_plan_name"`
Months int `json:"months"`
CumulativeMonths int `json:"cumulative_months"`
Context string `json:"context"`
IsGift bool `json:"is_gift"`
MultiMonthDuration int `json:"multi_month_duration"`
StreakMonths int `json:"streak_months"`
SubMessage struct {
Message string `json:"message"`
Emotes []struct {
Start int `json:"start"`
End int `json:"end"`
ID int `json:"id"`
} `json:"emotes"`
} `json:"sub_message"`
} `json:"message"`
} `json:"data"`
} `json:"event_data"`
}
// HypeTrainBeginMsg is a message that represents a hype train begin event that TAU sends
type HypeTrainBeginMsg struct {
*Event
EventData struct {
BroadcasterID string `json:"broadcaster_user_id"`
BroadcasterName string `json:"broadcaster_user_name"`
BroadcasterLogin string `json:"broadcaster_user_login"`
Total int `json:"total"`
Progress int `json:"progress"`
Goal int `json:"goal"`
StartedAt time.Time `json:"started_at"`
ExpiresAt time.Time `json:"expires_at"`
TopContributions []struct {
UserID string `json:"user_id"`
UserLogin string `json:"user_login"`
UserName string `json:"user_name"`
Type string `json:"type"`
Total int `json:"total"`
} `json:"top_contributions"`
LastContribution struct {
UserID string `json:"user_id"`
UserLogin string `json:"user_login"`
UserName string `json:"user_name"`
Type string `json:"type"`
Total int `json:"total"`
} `json:"last_contribution"`
} `json:"event_data"`
}
// HypeTrainProgressMsg is a message that represents a hype train progress event that TAU sends
type HypeTrainProgressMsg struct {
*Event
EventData struct {
BroadcasterID string `json:"broadcaster_user_id"`
BroadcasterName string `json:"broadcaster_user_name"`
BroadcasterLogin string `json:"broadcaster_user_login"`
Level int `json:"level"`
Total int `json:"total"`
Progress int `json:"progress"`
Goal int `json:"goal"`
StartedAt time.Time `json:"started_at"`
ExpiresAt time.Time `json:"expires_at"`
TopContributions []struct {
UserID string `json:"user_id"`
UserLogin string `json:"user_login"`
UserName string `json:"user_name"`
Type string `json:"type"`
Total int `json:"total"`
} `json:"top_contributions"`
LastContribution struct {
UserID string `json:"user_id"`
UserLogin string `json:"user_login"`
UserName string `json:"user_name"`
Type string `json:"type"`
Total int `json:"total"`
} `json:"last_contribution"`
} `json:"event_data"`
}
// HypeTrainEndedMsg is a message that represents a hype train end event that TAU sends
type HypeTrainEndedMsg struct {
*Event
EventData struct {
BroadcasterID string `json:"broadcaster_user_id"`
BroadcasterName string `json:"broadcaster_user_name"`
BroadcasterLogin string `json:"broadcaster_user_login"`
Level int `json:"level"`
Total int `json:"total"`
Progress int `json:"progress"`
StartedAt time.Time `json:"started_at"`
EndedAt time.Time `json:"ended_at"`
CooldownEndsAt time.Time `json:"cooldown_ends_at"`
TopContributions []struct {
UserID string `json:"user_id"`
UserLogin string `json:"user_login"`
UserName string `json:"user_name"`
Type string `json:"type"`
Total int `json:"total"`
} `json:"top_contributions"`
} `json:"event_data"`
}
// StreamOnlineMsg is a message that represents a stream online event that TAU sends
type StreamOnlineMsg struct {
*Event
EventData struct {
ID string `json:"id"`
BroadcasterID string `json:"broadcaster_user_id"`
BroadcasterName string `json:"broadcaster_user_name"`
BroadcasterLogin string `json:"broadcaster_user_login"`
Type string `json:"type"`
StartedAt time.Time `json:"started_at"`
} `json:"event_data"`
}
// StreamOfflineMsg is a message that represents a stream offline event that TAU sends
type StreamOfflineMsg struct {
*Event
EventData struct {
BroadcasterID string `json:"broadcaster_user_id"`
BroadcasterName string `json:"broadcaster_user_name"`
BroadcasterLogin string `json:"broadcaster_user_login"`
} `json:"event_data"`
}
// PointsRedemptionMsg is a message that represents a points redemption event that TAU sends
type PointsRedemptionMsg struct {
*Event
EventData struct {
BroadcasterID string `json:"broadcaster_user_id"`
BroadcasterName string `json:"broadcaster_user_name"`
BroadcasterLogin string `json:"broadcaster_user_login"`
ID string `json:"id"`
UserID string `json:"user_id"`
UserLogin string `json:"user_login"`
UserName string `json:"user_name"`
UserInput string `json:"user_input"`
Status string `json:"status"`
RedeemedAt time.Time `json:"redeemed_at"`
Reward struct {
ID string `json:"id"`
Title string `json:"title"`
Prompt string `json:"prompt"`
Cost int `json:"cost"`
} `json:"reward"`
} `json:"event_data"`
}