@overlaysymphony/twitch 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/package.json +2 -2
  2. package/src/authentication/authentication.ts +1 -1
  3. package/src/authentication/index.ts +1 -1
  4. package/src/chat/chat.ts +4 -4
  5. package/src/chat/helpers.ts +1 -1
  6. package/src/chat/index.ts +4 -3
  7. package/src/chat/interfaces/index.ts +2 -2
  8. package/src/chat/parser.ts +1 -1
  9. package/src/eventsub/events/automod.message.hold-2.ts +81 -0
  10. package/src/eventsub/events/automod.message.update-2.ts +94 -0
  11. package/src/eventsub/events/automod.settings.update-1.ts +65 -0
  12. package/src/eventsub/events/automod.terms.update-1.ts +59 -0
  13. package/src/eventsub/events/channel.ad_break.begin-1.ts +50 -0
  14. package/src/eventsub/events/channel.ban-1.ts +58 -0
  15. package/src/eventsub/events/channel.bits.use-1.ts +112 -0
  16. package/src/eventsub/events/channel.channel_points_automatic_reward_redemption.add-2.ts +88 -0
  17. package/src/eventsub/events/channel.channel_points_custom_reward.add-1.ts +101 -0
  18. package/src/eventsub/events/channel.channel_points_custom_reward.remove-1.ts +103 -0
  19. package/src/eventsub/events/channel.channel_points_custom_reward.update-1.ts +103 -0
  20. package/src/eventsub/events/channel.channel_points_custom_reward_redemption.add-1.ts +65 -0
  21. package/src/eventsub/events/channel.channel_points_custom_reward_redemption.update-1.ts +65 -0
  22. package/src/eventsub/events/channel.charity_campaign.donate-1.ts +69 -0
  23. package/src/eventsub/events/channel.charity_campaign.progress-1.ts +74 -0
  24. package/src/eventsub/events/channel.charity_campaign.start-1.ts +76 -0
  25. package/src/eventsub/events/channel.charity_campaign.stop-1.ts +76 -0
  26. package/src/eventsub/events/channel.chat.clear-1.ts +41 -0
  27. package/src/eventsub/events/channel.chat.clear_user_messages-1.ts +47 -0
  28. package/src/eventsub/events/channel.chat.message-1.ts +160 -0
  29. package/src/eventsub/events/channel.chat.message_delete-1.ts +49 -0
  30. package/src/eventsub/events/channel.chat.notification-1.ts +317 -0
  31. package/src/eventsub/events/channel.chat.user_message_hold-1.ts +75 -0
  32. package/src/eventsub/events/channel.chat.user_message_update-1.ts +82 -0
  33. package/src/eventsub/events/channel.chat_settings.update-1.ts +83 -0
  34. package/src/eventsub/events/channel.cheer-1.ts +50 -0
  35. package/src/eventsub/events/channel.follow-2.ts +49 -0
  36. package/src/eventsub/events/channel.goal.begin-1.ts +80 -0
  37. package/src/eventsub/events/channel.goal.end-1.ts +80 -0
  38. package/src/eventsub/events/channel.goal.progress-1.ts +80 -0
  39. package/src/eventsub/events/channel.guest_star_guest.update-beta.ts +85 -0
  40. package/src/eventsub/events/channel.guest_star_session.begin-beta.ts +50 -0
  41. package/src/eventsub/events/channel.guest_star_session.end-beta.ts +58 -0
  42. package/src/eventsub/events/channel.guest_star_settings.update-beta.ts +62 -0
  43. package/src/eventsub/events/channel.hype_train.begin-2.ts +90 -0
  44. package/src/eventsub/events/channel.hype_train.end-2.ts +70 -0
  45. package/src/eventsub/events/channel.hype_train.progress-2.ts +90 -0
  46. package/src/eventsub/events/channel.moderate-2.ts +258 -0
  47. package/src/eventsub/events/channel.moderator.add-1.ts +44 -0
  48. package/src/eventsub/events/channel.moderator.remove-1.ts +44 -0
  49. package/src/eventsub/events/channel.poll.begin-1.ts +73 -0
  50. package/src/eventsub/events/channel.poll.end-1.ts +75 -0
  51. package/src/eventsub/events/channel.poll.progress-1.ts +73 -0
  52. package/src/eventsub/events/channel.prediction.begin-1.ts +72 -0
  53. package/src/eventsub/events/channel.prediction.end-1.ts +76 -0
  54. package/src/eventsub/events/channel.prediction.lock-1.ts +72 -0
  55. package/src/eventsub/events/channel.prediction.progress-1.ts +72 -0
  56. package/src/eventsub/events/channel.raid-1.ts +48 -0
  57. package/src/eventsub/events/channel.shared_chat.begin-1.ts +55 -0
  58. package/src/eventsub/events/channel.shared_chat.end-1.ts +46 -0
  59. package/src/eventsub/events/channel.shared_chat.update-1.ts +55 -0
  60. package/src/eventsub/events/channel.shield_mode.begin-1.ts +51 -0
  61. package/src/eventsub/events/channel.shield_mode.end-1.ts +51 -0
  62. package/src/eventsub/events/channel.shoutout.create-1.ts +61 -0
  63. package/src/eventsub/events/channel.shoutout.receive-1.ts +51 -0
  64. package/src/eventsub/events/channel.subscribe-1.ts +48 -0
  65. package/src/eventsub/events/channel.subscription.end-1.ts +48 -0
  66. package/src/eventsub/events/channel.subscription.gift-1.ts +52 -0
  67. package/src/eventsub/events/channel.subscription.message-1.ts +66 -0
  68. package/src/eventsub/events/channel.suspicious_user.message-1.ts +85 -0
  69. package/src/eventsub/events/channel.suspicious_user.update-1.ts +55 -0
  70. package/src/eventsub/events/channel.unban-1.ts +50 -0
  71. package/src/eventsub/events/channel.unban_request.create-1.ts +53 -0
  72. package/src/eventsub/events/channel.unban_request.resolve-1.ts +64 -0
  73. package/src/eventsub/events/channel.update-2.ts +48 -0
  74. package/src/eventsub/events/channel.vip.add-1.ts +44 -0
  75. package/src/eventsub/events/channel.vip.remove-1.ts +44 -0
  76. package/src/eventsub/events/channel.warning.acknowledge-1.ts +47 -0
  77. package/src/eventsub/events/channel.warning.send-1.ts +57 -0
  78. package/src/eventsub/events/index.ts +73 -284
  79. package/src/eventsub/events/stream.offline-1.ts +38 -0
  80. package/src/eventsub/events/stream.online-1.ts +44 -0
  81. package/src/eventsub/events/user.update-1.ts +48 -0
  82. package/src/eventsub/events/user.whisper.message-1.ts +51 -0
  83. package/src/eventsub/events-helpers.ts +53 -25
  84. package/src/eventsub/eventsub.ts +37 -74
  85. package/src/eventsub/index.ts +8 -6
  86. package/src/eventsub/messages.ts +16 -4
  87. package/src/helix/channel-points/custom-rewards.ts +3 -3
  88. package/src/helix/channel-points/index.ts +1 -1
  89. package/src/helix/helix.ts +1 -1
  90. package/src/helix/subscriptions/index.ts +1 -1
  91. package/src/helix/subscriptions/subscriptions.ts +40 -47
  92. package/src/helix/users/index.ts +1 -1
  93. package/src/helix/users/users.ts +3 -3
  94. package/src/helpers/alerts/alerts.ts +5 -5
  95. package/src/helpers/alerts/index.ts +2 -2
  96. package/src/helpers/charity/charity.ts +2 -2
  97. package/src/helpers/charity/index.ts +1 -1
  98. package/src/helpers/goal/goal.ts +2 -2
  99. package/src/helpers/goal/index.ts +1 -1
  100. package/src/helpers/hype-train/hype-train.ts +2 -2
  101. package/src/helpers/hype-train/index.ts +1 -1
  102. package/src/helpers/poll/index.ts +1 -1
  103. package/src/helpers/poll/poll.ts +3 -3
  104. package/src/helpers/prediction/index.ts +1 -1
  105. package/src/helpers/prediction/prediction.ts +3 -3
  106. package/src/helpers/redemption/index.ts +1 -1
  107. package/src/helpers/redemption/redemption.ts +3 -3
  108. package/src/helpers/status/index.ts +1 -1
  109. package/src/helpers/status/status.ts +2 -2
  110. package/src/ui/authentication.ts +1 -1
  111. package/src/ui/popup.ts +26 -3
  112. package/src/eventsub/events/channel.ad_break.begin.ts +0 -51
  113. package/src/eventsub/events/channel.ban.ts +0 -59
  114. package/src/eventsub/events/channel.channel_points_custom_reward._.ts +0 -29
  115. package/src/eventsub/events/channel.channel_points_custom_reward.add.ts +0 -75
  116. package/src/eventsub/events/channel.channel_points_custom_reward.remove.ts +0 -77
  117. package/src/eventsub/events/channel.channel_points_custom_reward.update.ts +0 -77
  118. package/src/eventsub/events/channel.channel_points_custom_reward_redemption._.ts +0 -10
  119. package/src/eventsub/events/channel.channel_points_custom_reward_redemption.add.ts +0 -59
  120. package/src/eventsub/events/channel.channel_points_custom_reward_redemption.update.ts +0 -59
  121. package/src/eventsub/events/channel.charity_campaign.donate.ts +0 -66
  122. package/src/eventsub/events/channel.charity_campaign.progress.ts +0 -67
  123. package/src/eventsub/events/channel.charity_campaign.start.ts +0 -69
  124. package/src/eventsub/events/channel.charity_campaign.stop.ts +0 -69
  125. package/src/eventsub/events/channel.chat.clear.ts +0 -42
  126. package/src/eventsub/events/channel.chat.clear_user_messages.ts +0 -48
  127. package/src/eventsub/events/channel.chat.message_delete.ts +0 -50
  128. package/src/eventsub/events/channel.chat.notification.ts +0 -50
  129. package/src/eventsub/events/channel.cheer.ts +0 -51
  130. package/src/eventsub/events/channel.follow.ts +0 -50
  131. package/src/eventsub/events/channel.goal.begin.ts +0 -51
  132. package/src/eventsub/events/channel.goal.end.ts +0 -55
  133. package/src/eventsub/events/channel.goal.progress.ts +0 -51
  134. package/src/eventsub/events/channel.guest_star_guest.update.ts +0 -66
  135. package/src/eventsub/events/channel.guest_star_session.begin.ts +0 -46
  136. package/src/eventsub/events/channel.guest_star_session.end.ts +0 -48
  137. package/src/eventsub/events/channel.guest_star_settings.update.ts +0 -50
  138. package/src/eventsub/events/channel.hype_train._.ts +0 -12
  139. package/src/eventsub/events/channel.hype_train.begin.ts +0 -57
  140. package/src/eventsub/events/channel.hype_train.end.ts +0 -55
  141. package/src/eventsub/events/channel.hype_train.progress.ts +0 -70
  142. package/src/eventsub/events/channel.moderator.add.ts +0 -45
  143. package/src/eventsub/events/channel.moderator.remove.ts +0 -45
  144. package/src/eventsub/events/channel.poll._.ts +0 -26
  145. package/src/eventsub/events/channel.poll.begin.ts +0 -55
  146. package/src/eventsub/events/channel.poll.end.ts +0 -57
  147. package/src/eventsub/events/channel.poll.progress.ts +0 -55
  148. package/src/eventsub/events/channel.prediction._.ts +0 -25
  149. package/src/eventsub/events/channel.prediction.begin.ts +0 -51
  150. package/src/eventsub/events/channel.prediction.end.ts +0 -55
  151. package/src/eventsub/events/channel.prediction.lock.ts +0 -51
  152. package/src/eventsub/events/channel.prediction.progress.ts +0 -51
  153. package/src/eventsub/events/channel.raid.ts +0 -49
  154. package/src/eventsub/events/channel.shield_mode.begin.ts +0 -50
  155. package/src/eventsub/events/channel.shield_mode.end.ts +0 -50
  156. package/src/eventsub/events/channel.shoutout.create.ts +0 -62
  157. package/src/eventsub/events/channel.shoutout.receive.ts +0 -52
  158. package/src/eventsub/events/channel.subscribe.ts +0 -49
  159. package/src/eventsub/events/channel.subscription.end.ts +0 -49
  160. package/src/eventsub/events/channel.subscription.gift.ts +0 -53
  161. package/src/eventsub/events/channel.subscription.message.ts +0 -67
  162. package/src/eventsub/events/channel.unban.ts +0 -51
  163. package/src/eventsub/events/channel.update.ts +0 -49
  164. package/src/eventsub/events/stream.offline.ts +0 -39
  165. package/src/eventsub/events/stream.online.ts +0 -45
  166. package/src/eventsub/events/user.update.ts +0 -45
@@ -0,0 +1,90 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.hype_train.progress": ChannelHypeTrainProgress
6
+ }
7
+ }
8
+
9
+ /** Channel Hype Train Progress v2: When a Hype Train makes progress on the specified channel. */
10
+ type ChannelHypeTrainProgress = EventConfig<{
11
+ Type: "channel.hype_train.progress"
12
+ Version: "2"
13
+ /** The conditions to listen for when a Hype Train makes progress on the specified channel. */
14
+ Condition: {
15
+ /** The ID of the broadcaster that you want to get Hype Train progress notifications for. */
16
+ broadcaster_user_id: string
17
+ }
18
+ /** The event fired when a Hype Train makes progress on the specified channel. */
19
+ Event: {
20
+ /** The Hype Train ID. */
21
+ id: string
22
+ /** The requested broadcaster ID. */
23
+ broadcaster_user_id: string
24
+ /** The requested broadcaster login. */
25
+ broadcaster_user_login: string
26
+ /** The requested broadcaster display name. */
27
+ broadcaster_user_name: string
28
+ /** The current level of the Hype Train. */
29
+ level: number
30
+ /** Total points contributed to the Hype Train. */
31
+ total: number
32
+ /** The number of points contributed to the Hype Train at the current level. */
33
+ progress: number
34
+ /** The number of points required to reach the next level. */
35
+ goal: number
36
+ /** The contributors with the most points contributed. */
37
+ top_contributions: {
38
+ /** The ID of the user that made the contribution. */
39
+ user_id: string
40
+ /** The user's login name. */
41
+ user_login: string
42
+ /** The user's display name. */
43
+ user_name: string
44
+ /**
45
+ * The contribution method used. Possible values are:
46
+ * - bits - Bits contributions with Cheering, Power-ups, and Extensions.
47
+ * - subscription - Subscription activity like subscribing or gifting subscriptions.
48
+ * - other - Covers other contribution methods not listed.
49
+ */
50
+ type: string
51
+ /** The total amount contributed. If type is bits, total represents the amount of Bits used. If type is subscription, total is 500, 1000, or 2500 to represent tier 1, 2, or 3 subscriptions, respectively. */
52
+ total: number
53
+ }
54
+ /** The most recent contribution. */
55
+ last_contribution: {
56
+ /** The ID of the user that made the contribution. */
57
+ user_id: string
58
+ /** The user's login name. */
59
+ user_login: string
60
+ /** The user's display name. */
61
+ user_name: string
62
+ /**
63
+ * The contribution method used. Possible values are:
64
+ * - bits — Cheering with Bits.
65
+ * - subscription — Subscription activity like subscribing or gifting subscriptions.
66
+ * - other — Covers other contribution methods not listed.
67
+ */
68
+ type: string
69
+ /** The total amount contributed. If type is bits, total represents the amount of Bits used. If type is subscription, total is 500, 1000, or 2500 to represent tier 1, 2, or 3 subscriptions, respectively. */
70
+ total: number
71
+ }
72
+ /** The time when the Hype Train started. */
73
+ started_at: string
74
+ /** The time when the Hype Train expires. The expiration is extended when the Hype Train reaches a new level. */
75
+ expires_at: string
76
+ /** Indicates if the Hype Train is a Golden Kappa Train. */
77
+ is_golden_kappa_train: boolean
78
+ }
79
+ }>
80
+
81
+ registerEvent("channel.hype_train.progress", {
82
+ scopes: ["channel:read:hype"],
83
+ subscriber: (userId) => ({
84
+ type: "channel.hype_train.progress",
85
+ version: "2",
86
+ condition: {
87
+ broadcaster_user_id: userId,
88
+ },
89
+ }),
90
+ })
@@ -0,0 +1,258 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.moderate": ChannelModerate
6
+ }
7
+ }
8
+
9
+ /** Channel Moderate v2: When a moderator performs a moderation action in a channel. Includes warnings. */
10
+ type ChannelModerate = EventConfig<{
11
+ Type: "channel.moderate"
12
+ Version: "2"
13
+ /** The conditions to listen for when a moderator performs a moderation action in a channel. Includes warnings. */
14
+ Condition: {
15
+ /** The user ID of the broadcaster. */
16
+ broadcaster_user_id: string
17
+ /** The user ID of the moderator. */
18
+ moderator_user_id: string
19
+ }
20
+ /** The event fired when a moderator performs a moderation action in a channel. Includes warnings. */
21
+ Event: {
22
+ /** The ID of the broadcaster. */
23
+ broadcaster_user_id: string
24
+ /** The login of the broadcaster. */
25
+ broadcaster_user_login: string
26
+ /** The user name of the broadcaster. */
27
+ broadcaster_user_name: string
28
+ /** The channel in which the action originally occurred. Is the same as the broadcaster_user_id if not in shared chat. */
29
+ source_broadcaster_user_id: string
30
+ /** The channel in which the action originally occurred. Is the same as the broadcaster_user_login if not in shared chat. */
31
+ source_broadcaster_user_login: string
32
+ /** The channel in which the action originally occurred. Is null when the moderator action happens in the same channel as the broadcaster. Is not null when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster. */
33
+ source_broadcaster_user_name: string
34
+ /** The ID of the moderator who performed the action. */
35
+ moderator_user_id: string
36
+ /** The login of the moderator. */
37
+ moderator_user_login: string
38
+ /** The user name of the moderator. */
39
+ moderator_user_name: string
40
+ /**
41
+ * The type of action: Possible values are:
42
+ * - ban
43
+ * - timeout
44
+ * - unban
45
+ * - untimeout
46
+ * - clear
47
+ * - emoteonly
48
+ * - emoteonlyoff
49
+ * - followers
50
+ * - followersoff
51
+ * - uniquechat
52
+ * - uniquechatoff
53
+ * - slow
54
+ * - slowoff
55
+ * - subscribers
56
+ * - subscribersoff
57
+ * - unraid
58
+ * - delete
59
+ * - unvip
60
+ * - vip
61
+ * - raid
62
+ * - add_blocked_term
63
+ * - add_permitted_term
64
+ * - remove_blocked_term
65
+ * - remove_permitted_term
66
+ * - mod
67
+ * - unmod
68
+ * - approve_unban_request
69
+ * - deny_unban_request
70
+ * - shared_chat_ban
71
+ * - shared_chat_timeout
72
+ * - shared_chat_untimeout
73
+ * - shared_chat_unban
74
+ * - shared_chat_delete
75
+ */
76
+ action: string
77
+ /** Optional.. Metadata associated with the followers command. */
78
+ followers?: {
79
+ /** The length of time, in minutes, that the followers must have followed the broadcaster to participate in the chat room. */
80
+ follow_duration_minutes: number
81
+ }
82
+ /** Metadata associated with the slow command. */
83
+ slow?: {
84
+ /** The amount of time, in seconds, that users need to wait between sending messages. */
85
+ wait_time_seconds: number
86
+ }
87
+ /** Metadata associated with the vip command. */
88
+ vip?: {
89
+ /** The ID of the user gaining VIP status. */
90
+ user_id: string
91
+ /** The login of the user gaining VIP status. */
92
+ user_login: string
93
+ /** The user name of the user gaining VIP status. */
94
+ user_name: string
95
+ }
96
+ /** Metadata associated with the unvip command. */
97
+ unvip?: {
98
+ /** The ID of the user losing VIP status. */
99
+ user_id: string
100
+ /** The login of the user losing VIP status. */
101
+ user_login: string
102
+ /** The user name of the user losing VIP status. */
103
+ user_name: string
104
+ }
105
+ /** Metadata associated with the mod command. */
106
+ mod?: {
107
+ /** The ID of the user gaining mod status. */
108
+ user_id: string
109
+ /** The login of the user gaining mod status. */
110
+ user_login: string
111
+ /** The user name of the user gaining mod status. */
112
+ user_name: string
113
+ }
114
+ /** Metadata associated with the unmod command. */
115
+ unmod?: {
116
+ /** The ID of the user losing mod status. */
117
+ user_id: string
118
+ /** The login of the user losing mod status. */
119
+ user_login: string
120
+ /** The user name of the user losing mod status. */
121
+ user_name: string
122
+ }
123
+ /** Metadata associated with the ban command. */
124
+ ban?: {
125
+ /** The ID of the user being banned. */
126
+ user_id: string
127
+ /** The login of the user being banned. */
128
+ user_login: string
129
+ /** The user name of the user being banned. */
130
+ user_name: string
131
+ /** Reason given for the ban. */
132
+ reason?: string
133
+ }
134
+ /** Metadata associated with the unban command. */
135
+ unban?: {
136
+ /** The ID of the user being unbanned. */
137
+ user_id: string
138
+ /** The login of the user being unbanned. */
139
+ user_login: string
140
+ /** The user name of the user being unbanned. */
141
+ user_name: string
142
+ }
143
+ /** Optional.. Metadata associated with the timeout command. */
144
+ timeout?: {
145
+ /** The ID of the user being timed out. */
146
+ user_id: string
147
+ /** The login of the user being timed out. */
148
+ user_login: string
149
+ /** The user name of the user being timed out. */
150
+ user_name: string
151
+ /** Optional.. The reason given for the timeout. */
152
+ reason?: string
153
+ /** The time at which the timeout ends. */
154
+ expires_at: string
155
+ }
156
+ /** Metadata associated with the untimeout command. */
157
+ untimeout?: {
158
+ /** The ID of the user being untimed out. */
159
+ user_id: string
160
+ /** The login of the user being untimed out. */
161
+ user_login: string
162
+ /** The user name of the user untimed out. */
163
+ user_name: string
164
+ }
165
+ /** Optional.. Metadata associated with the raid command. */
166
+ raid?: {
167
+ /** The ID of the user being raided. */
168
+ user_id: string
169
+ /** The login of the user being raided. */
170
+ user_login: string
171
+ /** The user name of the user raided. */
172
+ user_name: string
173
+ /** The viewer count. */
174
+ viewer_count: number
175
+ }
176
+ /** Metadata associated with the unraid command. */
177
+ unraid?: {
178
+ /** The ID of the user no longer being raided. */
179
+ user_id: string
180
+ /** The login of the user no longer being raided. */
181
+ user_login: string
182
+ /** The user name of the no longer user raided. */
183
+ user_name: string
184
+ }
185
+ /** Metadata associated with the delete command. */
186
+ delete?: {
187
+ /** The ID of the user whose message is being deleted. */
188
+ user_id: string
189
+ /** The login of the user. */
190
+ user_login: string
191
+ /** The user name of the user. */
192
+ user_name: string
193
+ /** The ID of the message being deleted. */
194
+ message_id: string
195
+ /** The message body of the message being deleted. */
196
+ message_body: string
197
+ }
198
+ /** Metadata associated with the automod terms changes. */
199
+ automod_terms?: {
200
+ /** Either "add" or "remove". */
201
+ action: string
202
+ /** Either "blocked" or "permitted". */
203
+ list: string
204
+ /** Terms being added or removed. */
205
+ terms: string[]
206
+ /** Whether the terms were added due to an Automod message approve/deny action. */
207
+ from_automod: boolean
208
+ }
209
+ /** Metadata associated with an unban request. */
210
+ unban_request?: {
211
+ /** Whether or not the unban request was approved or denied. */
212
+ is_approved: boolean
213
+ /** The ID of the banned user. */
214
+ user_id: string
215
+ /** The login of the user. */
216
+ user_login: string
217
+ /** The user name of the user. */
218
+ user_name: string
219
+ /** The message included by the moderator explaining their approval or denial. */
220
+ moderator_message: string
221
+ }
222
+ /** Information about the shared_chat_ban event. Is null if action is not shared_chat_ban . This field has the same information as the ban field but for a action that happened for a channel in a shared chat session other than the broadcaster in the subscription condition. */
223
+ shared_chat_ban?: object
224
+ /** Information about the shared_chat_unban event. Is null if action is not shared_chat_unban . This field has the same information as the unban field but for a action that happened for a channel in a shared chat session other than the broadcaster in the subscription condition. */
225
+ shared_chat_unban?: object
226
+ /** Information about the shared_chat_timeout event. Is null if action is not shared_chat_timeout . This field has the same information as the timeout field but for a action that happened for a channel in a shared chat session other than the broadcaster in the subscription condition. */
227
+ shared_chat_timeout?: object
228
+ /** Information about the shared_chat_untimeout event. Is null if action is not shared_chat_untimeout . This field has the same information as the untimeout field but for a action that happened for a channel in a shared chat session other than the broadcaster in the subscription condition. */
229
+ shared_chat_untimeout?: object
230
+ /** Information about the shared_chat_delete event. Is null if action is not shared_chat_delete . This field has the same information as the delete field but for a action that happened for a channel in a shared chat session other than the broadcaster in the subscription condition. */
231
+ shared_chat_delete?: object
232
+ }
233
+ }>
234
+
235
+ registerEvent("channel.moderate", {
236
+ scopes: [
237
+ "moderator:manage:banned",
238
+ "moderator:manage:blocked",
239
+ "moderator:manage:chat",
240
+ "moderator:manage:unban",
241
+ "moderator:manage:warnings",
242
+ "moderator:read:banned",
243
+ "moderator:read:blocked",
244
+ "moderator:read:chat",
245
+ "moderator:read:moderators",
246
+ "moderator:read:unban",
247
+ "moderator:read:vips",
248
+ "moderator:read:warnings",
249
+ ],
250
+ subscriber: (userId) => ({
251
+ type: "channel.moderate",
252
+ version: "2",
253
+ condition: {
254
+ broadcaster_user_id: userId,
255
+ moderator_user_id: userId,
256
+ },
257
+ }),
258
+ })
@@ -0,0 +1,44 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.moderator.add": ChannelModeratorAdd
6
+ }
7
+ }
8
+
9
+ /** Channel Moderator Add v1: When moderator privileges were added to a user on the specified channel. */
10
+ type ChannelModeratorAdd = EventConfig<{
11
+ Type: "channel.moderator.add"
12
+ Version: "1"
13
+ /** The conditions to listen for when moderator privileges were added to a user on the specified channel. */
14
+ Condition: {
15
+ /** The broadcaster user ID for the channel you want to get moderator addition notifications for. */
16
+ broadcaster_user_id: string
17
+ }
18
+ /** The event fired when moderator privileges were added to a user on the specified channel. */
19
+ Event: {
20
+ /** The requested broadcaster ID. */
21
+ broadcaster_user_id: string
22
+ /** The requested broadcaster login. */
23
+ broadcaster_user_login: string
24
+ /** The requested broadcaster display name. */
25
+ broadcaster_user_name: string
26
+ /** The user ID of the new moderator. */
27
+ user_id: string
28
+ /** The user login of the new moderator. */
29
+ user_login: string
30
+ /** The display name of the new moderator. */
31
+ user_name: string
32
+ }
33
+ }>
34
+
35
+ registerEvent("channel.moderator.add", {
36
+ scopes: ["moderation:read"],
37
+ subscriber: (userId) => ({
38
+ type: "channel.moderator.add",
39
+ version: "1",
40
+ condition: {
41
+ broadcaster_user_id: userId,
42
+ },
43
+ }),
44
+ })
@@ -0,0 +1,44 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.moderator.remove": ChannelModeratorRemove
6
+ }
7
+ }
8
+
9
+ /** Channel Moderator Remove v1: When moderator privileges were removed from a user on the specified channel. */
10
+ type ChannelModeratorRemove = EventConfig<{
11
+ Type: "channel.moderator.remove"
12
+ Version: "1"
13
+ /** The conditions to listen for when moderator privileges were removed from a user on the specified channel. */
14
+ Condition: {
15
+ /** The broadcaster user ID for the channel you want to get moderator removal notifications for. */
16
+ broadcaster_user_id: string
17
+ }
18
+ /** The event fired when moderator privileges were removed from a user on the specified channel. */
19
+ Event: {
20
+ /** The requested broadcaster ID. */
21
+ broadcaster_user_id: string
22
+ /** The requested broadcaster login. */
23
+ broadcaster_user_login: string
24
+ /** The requested broadcaster display name. */
25
+ broadcaster_user_name: string
26
+ /** The user ID of the removed moderator. */
27
+ user_id: string
28
+ /** The user login of the removed moderator. */
29
+ user_login: string
30
+ /** The display name of the removed moderator. */
31
+ user_name: string
32
+ }
33
+ }>
34
+
35
+ registerEvent("channel.moderator.remove", {
36
+ scopes: ["moderation:read"],
37
+ subscriber: (userId) => ({
38
+ type: "channel.moderator.remove",
39
+ version: "1",
40
+ condition: {
41
+ broadcaster_user_id: userId,
42
+ },
43
+ }),
44
+ })
@@ -0,0 +1,73 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.poll.begin": ChannelPollBegin
6
+ }
7
+ }
8
+
9
+ /** Channel Poll Begin v1: When a poll started on the specified channel. */
10
+ type ChannelPollBegin = EventConfig<{
11
+ Type: "channel.poll.begin"
12
+ Version: "1"
13
+ /** The conditions to listen for when a poll started on the specified channel. */
14
+ Condition: {
15
+ /** The broadcaster user ID of the channel for which "poll begin" notifications will be received. */
16
+ broadcaster_user_id: string
17
+ }
18
+ /** The event fired when a poll started on the specified channel. */
19
+ Event: {
20
+ /** ID of the poll. */
21
+ id: string
22
+ /** The requested broadcaster ID. */
23
+ broadcaster_user_id: string
24
+ /** The requested broadcaster login. */
25
+ broadcaster_user_login: string
26
+ /** The requested broadcaster display name. */
27
+ broadcaster_user_name: string
28
+ /** Question displayed for the poll. */
29
+ title: string
30
+ /** An array of choices for the poll. */
31
+ choices: Array<{
32
+ /** ID for the choice. */
33
+ id: string
34
+ /** Text displayed for the choice. */
35
+ title: string
36
+ /** Not used; will be set to 0. */
37
+ bits_votes: number
38
+ /** Number of votes received via Channel Points. */
39
+ channel_points_votes: number
40
+ /** Total number of votes received for the choice across all methods of voting. */
41
+ votes: number
42
+ }>
43
+ /** Not supported. */
44
+ bits_voting: {
45
+ /** Not used; will be set to false. */
46
+ is_enabled: boolean
47
+ /** Not used; will be set to 0. */
48
+ amount_per_vote: number
49
+ }
50
+ /** The Channel Points voting settings for the poll. */
51
+ channel_points_voting: {
52
+ /** Indicates if Channel Points can be used for voting. */
53
+ is_enabled: boolean
54
+ /** Number of Channel Points required to vote once with Channel Points. */
55
+ amount_per_vote: number
56
+ }
57
+ /** The time the poll started. */
58
+ started_at: string
59
+ /** The time the poll will end. */
60
+ ends_at: string
61
+ }
62
+ }>
63
+
64
+ registerEvent("channel.poll.begin", {
65
+ scopes: ["channel:manage:polls", "channel:read:polls"],
66
+ subscriber: (userId) => ({
67
+ type: "channel.poll.begin",
68
+ version: "1",
69
+ condition: {
70
+ broadcaster_user_id: userId,
71
+ },
72
+ }),
73
+ })
@@ -0,0 +1,75 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.poll.end": ChannelPollEnd
6
+ }
7
+ }
8
+
9
+ /** Channel Poll End v1: When a poll ended on the specified channel. */
10
+ type ChannelPollEnd = EventConfig<{
11
+ Type: "channel.poll.end"
12
+ Version: "1"
13
+ /** The conditions to listen for when a poll ended on the specified channel. */
14
+ Condition: {
15
+ /** The broadcaster user ID of the channel for which "poll end" notifications will be received. */
16
+ broadcaster_user_id: string
17
+ }
18
+ /** The event fired when a poll ended on the specified channel. */
19
+ Event: {
20
+ /** ID of the poll. */
21
+ id: string
22
+ /** The requested broadcaster ID. */
23
+ broadcaster_user_id: string
24
+ /** The requested broadcaster login. */
25
+ broadcaster_user_login: string
26
+ /** The requested broadcaster display name. */
27
+ broadcaster_user_name: string
28
+ /** Question displayed for the poll. */
29
+ title: string
30
+ /** An array of choices for the poll. Includes vote counts. */
31
+ choices: Array<{
32
+ /** ID for the choice. */
33
+ id: string
34
+ /** Text displayed for the choice. */
35
+ title: string
36
+ /** Not used; will be set to 0. */
37
+ bits_votes: number
38
+ /** Number of votes received via Channel Points. */
39
+ channel_points_votes: number
40
+ /** Total number of votes received for the choice across all methods of voting. */
41
+ votes: number
42
+ }>
43
+ /** Not supported. */
44
+ bits_voting: {
45
+ /** Not used; will be set to false. */
46
+ is_enabled: boolean
47
+ /** Not used; will be set to 0. */
48
+ amount_per_vote: number
49
+ }
50
+ /** The Channel Points voting settings for the poll. */
51
+ channel_points_voting: {
52
+ /** Indicates if Channel Points can be used for voting. */
53
+ is_enabled: boolean
54
+ /** Number of Channel Points required to vote once with Channel Points. */
55
+ amount_per_vote: number
56
+ }
57
+ /** The status of the poll. Valid values are completed, archived, and terminated. */
58
+ status: string
59
+ /** The time the poll started. */
60
+ started_at: string
61
+ /** The time the poll ended. */
62
+ ended_at: string
63
+ }
64
+ }>
65
+
66
+ registerEvent("channel.poll.end", {
67
+ scopes: ["channel:manage:polls", "channel:read:polls"],
68
+ subscriber: (userId) => ({
69
+ type: "channel.poll.end",
70
+ version: "1",
71
+ condition: {
72
+ broadcaster_user_id: userId,
73
+ },
74
+ }),
75
+ })
@@ -0,0 +1,73 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.poll.progress": ChannelPollProgress
6
+ }
7
+ }
8
+
9
+ /** Channel Poll Progress v1: When users respond to a poll on the specified channel. */
10
+ type ChannelPollProgress = EventConfig<{
11
+ Type: "channel.poll.progress"
12
+ Version: "1"
13
+ /** The conditions to listen for when users respond to a poll on the specified channel. */
14
+ Condition: {
15
+ /** The broadcaster user ID of the channel for which "poll progress" notifications will be received. */
16
+ broadcaster_user_id: string
17
+ }
18
+ /** The event fired when users respond to a poll on the specified channel. */
19
+ Event: {
20
+ /** ID of the poll. */
21
+ id: string
22
+ /** The requested broadcaster ID. */
23
+ broadcaster_user_id: string
24
+ /** The requested broadcaster login. */
25
+ broadcaster_user_login: string
26
+ /** The requested broadcaster display name. */
27
+ broadcaster_user_name: string
28
+ /** Question displayed for the poll. */
29
+ title: string
30
+ /** An array of choices for the poll. Includes vote counts. */
31
+ choices: Array<{
32
+ /** ID for the choice. */
33
+ id: string
34
+ /** Text displayed for the choice. */
35
+ title: string
36
+ /** Not used; will be set to 0. */
37
+ bits_votes: number
38
+ /** Number of votes received via Channel Points. */
39
+ channel_points_votes: number
40
+ /** Total number of votes received for the choice across all methods of voting. */
41
+ votes: number
42
+ }>
43
+ /** Not supported. */
44
+ bits_voting: {
45
+ /** Not used; will be set to false. */
46
+ is_enabled: boolean
47
+ /** Not used; will be set to 0. */
48
+ amount_per_vote: number
49
+ }
50
+ /** The Channel Points voting settings for the poll. */
51
+ channel_points_voting: {
52
+ /** Indicates if Channel Points can be used for voting. */
53
+ is_enabled: boolean
54
+ /** Number of Channel Points required to vote once with Channel Points. */
55
+ amount_per_vote: number
56
+ }
57
+ /** The time the poll started. */
58
+ started_at: string
59
+ /** The time the poll will end. */
60
+ ends_at: string
61
+ }
62
+ }>
63
+
64
+ registerEvent("channel.poll.progress", {
65
+ scopes: ["channel:manage:polls", "channel:read:polls"],
66
+ subscriber: (userId) => ({
67
+ type: "channel.poll.progress",
68
+ version: "1",
69
+ condition: {
70
+ broadcaster_user_id: userId,
71
+ },
72
+ }),
73
+ })