@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,317 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.chat.notification": ChannelChatNotification
6
+ }
7
+ }
8
+
9
+ /** Channel Chat Notification v1: When an event that appears in chat has occurred. */
10
+ type ChannelChatNotification = EventConfig<{
11
+ Type: "channel.chat.notification"
12
+ Version: "1"
13
+ /** The conditions to listen for when an event that appears in chat has occurred. */
14
+ Condition: {
15
+ /** User ID of the channel to receive chat notification events for. */
16
+ broadcaster_user_id: string
17
+ /** The user ID to read chat as. */
18
+ user_id: string
19
+ }
20
+ /** The event fired when an event that appears in chat has occurred. */
21
+ Event: {
22
+ /** The broadcaster user ID. */
23
+ broadcaster_user_id: string
24
+ /** The broadcaster display name. */
25
+ broadcaster_user_name: string
26
+ /** The broadcaster login. */
27
+ broadcaster_user_login: string
28
+ /** The user ID of the user that sent the message. */
29
+ chatter_user_id: string
30
+ /** The user login of the user that sent the message. */
31
+ chatter_user_name: string
32
+ /** Whether or not the chatter is anonymous. */
33
+ chatter_is_anonymous: boolean
34
+ /** The color of the user's name in the chat room. */
35
+ color: string
36
+ /** The color of the user's name in the chat room. */
37
+ badges: Array<{
38
+ /** An ID that identifies this set of chat badges. */
39
+ set_id: string
40
+ /** An ID that identifies this version of the badge. The ID can be any value. */
41
+ id: string
42
+ /** Contains metadata related to the chat badges in the badges tag. Currently, this tag contains metadata only for subscriber badges, to indicate the number of months the user has been a subscriber. */
43
+ info: string
44
+ }>
45
+ /** The message Twitch shows in the chat room for this notice. */
46
+ system_message: string
47
+ /** A UUID that identifies the message. */
48
+ message_id: string
49
+ /** The structured chat message. */
50
+ message: {
51
+ /** The chat message in plain text. */
52
+ text: object
53
+ /** Ordered list of chat message fragments. */
54
+ fragments: Array<{
55
+ /**
56
+ * The type of message fragment. Possible values:
57
+ * - text
58
+ * - cheermote
59
+ * - emote
60
+ * - mention
61
+ */
62
+ type: string
63
+ /** Message text in fragment. */
64
+ text: string
65
+ /** Metadata pertaining to the cheermote. */
66
+ cheermote?: {
67
+ /** The name portion of the Cheermote string that you use in chat to cheer Bits. The full Cheermote string is the concatenation of {prefix} + {number of Bits}. */
68
+ prefix: object
69
+ /** The amount of Bits cheered. */
70
+ bits: number
71
+ /** The tier level of the cheermote. */
72
+ tier: number
73
+ }
74
+ /** Metadata pertaining to the emote. */
75
+ emote?: {
76
+ /** An ID that uniquely identifies this emote. */
77
+ id: string
78
+ /** An ID that identifies the emote set that the emote belongs to. */
79
+ emote_set_id: string
80
+ /** The ID of the broadcaster who owns the emote. */
81
+ owner_id: string
82
+ /**
83
+ * The formats that the emote is available in.
84
+ * - animated - An animated GIF is available for this emote.
85
+ * - static - A static PNG file is available for this emote.
86
+ */
87
+ format: string[]
88
+ }
89
+ /** Metadata pertaining to the mention. */
90
+ mention?: {
91
+ /** The user ID of the mentioned user. */
92
+ user_id: string
93
+ /** The user name of the mentioned user. */
94
+ user_name: string
95
+ /** The user login of the mentioned user. */
96
+ user_login: string
97
+ }
98
+ }>
99
+ }
100
+ /**
101
+ * The type of notice. Possible values are:
102
+ * - sub
103
+ * - resub
104
+ * - sub_gift
105
+ * - community_sub_gift
106
+ * - gift_paid_upgrade
107
+ * - prime_paid_upgrade
108
+ * - raid
109
+ * - unraid
110
+ * - pay_it_forward
111
+ * - announcement
112
+ * - bits_badge_tier
113
+ * - charity_donation
114
+ * - shared_chat_sub
115
+ * - shared_chat_resub
116
+ * - shared_chat_sub_gift
117
+ * - shared_chat_community_sub_gift
118
+ * - shared_chat_gift_paid_upgrade
119
+ * - shared_chat_prime_paid_upgrade
120
+ * - shared_chat_raid
121
+ * - shared_chat_pay_it_forward
122
+ * - shared_chat_announcement
123
+ */
124
+ notice_type: string
125
+ /** Information about the sub event. Null if notice_type is not sub. */
126
+ sub: {
127
+ /**
128
+ * The type of subscription plan being used. Possible values are:
129
+ * - 1000 - First level of paid or Prime subscription.
130
+ * - 2000 - Second level of paid subscription.
131
+ * - 3000 - Third level of paid subscription.
132
+ */
133
+ sub_tier: string
134
+ /** Indicates if the subscription was obtained through Amazon Prime. */
135
+ is_prime: boolean
136
+ /** The number of months the subscription is for. */
137
+ duration_months: number
138
+ }
139
+ /** Information about the resub event. Null if notice_type is not resub. */
140
+ resub: {
141
+ /** The total number of months the user has subscribed. */
142
+ cumulative_months: number
143
+ /** The number of months the subscription is for. */
144
+ duration_months: number
145
+ /** The total number of months the user has subscribed. */
146
+ streak_months: number
147
+ /**
148
+ * The type of subscription plan being used. Possible values are:
149
+ * - 1000 - First level of paid or Prime subscription.
150
+ * - 2000 - Second level of paid subscription.
151
+ * - 3000 - Third level of paid subscription.
152
+ */
153
+ sub_tier: string
154
+ /** The number of consecutive months the user has subscribed. */
155
+ is_prime?: boolean
156
+ /** Whether or not the resub was a result of a gift. */
157
+ is_gift: boolean
158
+ /** Whether or not the gift was anonymous. */
159
+ gifter_is_anonymous?: boolean
160
+ /** The user ID of the subscription gifter. Null if anonymous. */
161
+ gifter_user_id: string
162
+ /** The user name of the subscription gifter. Null if anonymous. */
163
+ gifter_user_name: string
164
+ /** The user login of the subscription gifter. Null if anonymous. */
165
+ gifter_user_login?: string
166
+ }
167
+ /** Information about the gift sub event. Null if notice_type is not sub_gift. */
168
+ sub_gift: {
169
+ /** The number of months the subscription is for. */
170
+ duration_months: number
171
+ /** The amount of gifts the gifter has given in this channel. Null if anonymous. */
172
+ cumulative_total?: number
173
+ /** The user ID of the subscription gift recipient. */
174
+ recipient_user_id: string
175
+ /** The user name of the subscription gift recipient. */
176
+ recipient_user_name: string
177
+ /** The user login of the subscription gift recipient. */
178
+ recipient_user_login: string
179
+ /**
180
+ * The type of subscription plan being used. Possible values are:
181
+ * - 1000 - First level of paid or Prime subscription.
182
+ * - 2000 - Second level of paid subscription.
183
+ * - 3000 - Third level of paid subscription.
184
+ */
185
+ sub_tier: string
186
+ /** The ID of the associated community gift. Null if not associated with a community gift. */
187
+ community_gift_id?: string
188
+ }
189
+ /** Information about the community gift sub event. Null if notice_type is not community_sub_gift. */
190
+ community_sub_gift: {
191
+ /** The ID of the associated community gift. */
192
+ id: string
193
+ /** Number of subscriptions being gifted. */
194
+ total: number
195
+ /** The type of subscription plan being used. Possible values are: <ul><li>1000 - First level of paid or Prime subscription.</li><li>2000 - Second level of paid subscription.</li><li>3000 - Third level of paid subscription.</li></ul> */
196
+ sub_tier: string
197
+ /** The amount of gifts the gifter has given in this channel. Null if anonymous. */
198
+ cumulative_total?: number
199
+ }
200
+ /** Information about the community gift paid upgrade event. Null if notice_type is not gift_paid_upgrade. */
201
+ gift_paid_upgrade: {
202
+ /** Whether the gift was given anonymously. */
203
+ gifter_is_anonymous: boolean
204
+ /** The user ID of the user who gifted the subscription. Null if anonymous. */
205
+ gifter_user_id?: string
206
+ /** The user name of the user who gifted the subscription. Null if anonymous. */
207
+ gifter_user_name?: string
208
+ }
209
+ /** Information about the Prime gift paid upgrade event. Null if notice_type is not prime_paid_upgrade */
210
+ prime_paid_upgrade: {
211
+ /**
212
+ * The type of subscription plan being used. Possible values are:
213
+ * - 1000 - First level of paid or Prime subscription.
214
+ * - 2000 - Second level of paid subscription.
215
+ * - 3000 - Third level of paid subscription.
216
+ */
217
+ sub_tier: string
218
+ }
219
+ /** Information about the pay it forward event. Null if notice_type is not pay_it_forward */
220
+ pay_it_forward: {
221
+ /** Whether the gift was given anonymously. */
222
+ gifter_is_anonymous: boolean
223
+ /** The user ID of the user who gifted the subscription. Null if anonymous. */
224
+ gifter_user_id: string
225
+ /** The user name of the user who gifted the subscription. Null if anonymous. */
226
+ gifter_user_name?: string
227
+ /** The user login of the user who gifted the subscription. Null if anonymous. */
228
+ gifter_user_login: string
229
+ }
230
+ /** Information about the raid event. Null if notice_type is not raid */
231
+ raid: {
232
+ /** The user ID of the broadcaster raiding this channel. */
233
+ user_id: string
234
+ /** The user name of the broadcaster raiding this channel. */
235
+ user_name: string
236
+ /** The login name of the broadcaster raiding this channel. */
237
+ user_login: string
238
+ /** The number of viewers raiding this channel from the broadcaster's channel. */
239
+ viewer_count: number
240
+ /** Profile image URL of the broadcaster raiding this channel. */
241
+ profile_image_url: string
242
+ }
243
+ /** Returns an empty payload if notice_type is not unraid, otherwise returns null. */
244
+ unraid: object
245
+ /** Information about the announcement event. Null if notice_type is not {::nomarkdown} announcement */
246
+ announcement: {
247
+ /** Color of the announcement. */
248
+ color: string
249
+ }
250
+ /** Information about the Bits badge tier event. Null if notice_type is not bits_badge_tier */
251
+ bits_badge_tier: {
252
+ /** The tier of the Bits badge the user just earned. */
253
+ tier: number
254
+ }
255
+ /** Information about the announcement event. Null if notice_type is not charity_donation */
256
+ charity_donation: {
257
+ /** Name of the charity. */
258
+ charity_name: string
259
+ /** An object that contains the amount of money that the user paid. */
260
+ amount: {
261
+ /** The monetary amount. The amount is specified in the currency's minor unit. */
262
+ value: number
263
+ /** The number of decimal places used by the currency. */
264
+ decimal_place: number
265
+ /** The ISO-4217 three-letter currency code that identifies the type of currency in value. */
266
+ currency: string
267
+ }
268
+ }
269
+ /** The broadcaster user ID of the channel the message was sent from. Is null when the message notification 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. */
270
+ source_broadcaster_user_id?: string
271
+ /** The user name of the broadcaster of the channel the message was sent from. Is null when the message notification 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. */
272
+ source_broadcaster_user_name?: string
273
+ /** The login of the broadcaster of the channel the message was sent from. Is null when the message notification 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. */
274
+ source_broadcaster_user_login?: string
275
+ /** The UUID that identifies the source message from the channel the message was sent from. Is null when the message 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. */
276
+ source_message_id?: string
277
+ /** The list of chat badges for the chatter in the channel the message was sent from. Is null when the message 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. */
278
+ source_badges?: {
279
+ /** The ID that identifies this set of chat badges. */
280
+ set_id: string
281
+ /** The ID that identifies this version of the badge. The ID can be any value. */
282
+ id: string
283
+ /** Contains metadata related to the chat badges in the badges tag. Currently, this tag contains metadata only for subscriber badges, to indicate the number of months the user has been a subscriber. */
284
+ info: string
285
+ }
286
+ /** Information about the shared_chat_sub event. Is null if notice_type is not shared_chat_sub . This field has the same information as the sub field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition. */
287
+ shared_chat_sub?: object
288
+ /** Information about the shared_chat_resub event. Is null if notice_type is not shared_chat_resub . This field has the same information as the resub field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition. */
289
+ shared_chat_resub?: object
290
+ /** Information about the shared_chat_sub_gift event. Is null if notice_type is not shared_chat_sub_gift . This field has the same information as the chat_sub_gift field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition. */
291
+ shared_chat_sub_gift?: object
292
+ /** Information about the shared_chat_community_sub_gift event. Is null if notice_type is not shared_chat_community_sub_gift . This field has the same information as the community_sub_gift field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition. */
293
+ shared_chat_community_sub_gift?: object
294
+ /** Information about the shared_chat_gift_paid_upgrade event. Is null if notice_type is not shared_chat_gift_paid_upgrade . This field has the same information as the gift_paid_upgrade field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition. */
295
+ shared_chat_gift_paid_upgrade?: object
296
+ /** Information about the shared_chat_chat_prime_paid_upgrade event. Is null if notice_type is not shared_chat_prime_paid_upgrade . This field has the same information as the prime_paid_upgrade field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition. */
297
+ shared_chat_prime_paid_upgrade?: object
298
+ /** Information about the shared_chat_pay_it_forward event. Is null if notice_type is not shared_chat_pay_it_forward . This field has the same information as the pay_it_forward field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition. */
299
+ shared_chat_pay_it_forward?: object
300
+ /** Information about the shared_chat_raid event. Is null if notice_type is not shared_chat_raid . This field has the same information as the raid field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition. */
301
+ shared_chat_raid?: object
302
+ /** Information about the shared_chat_announcement event. Is null if notice_type is not shared_chat_announcement . This field has the same information as the announcement field but for a notice that happened for a channel in a shared chat session other than the broadcaster in the subscription condition. */
303
+ shared_chat_announcement?: object
304
+ }
305
+ }>
306
+
307
+ registerEvent("channel.chat.notification", {
308
+ scopes: ["user:read:chat"],
309
+ subscriber: (userId) => ({
310
+ type: "channel.chat.notification",
311
+ version: "1",
312
+ condition: {
313
+ broadcaster_user_id: userId,
314
+ user_id: userId,
315
+ },
316
+ }),
317
+ })
@@ -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.chat.user_message_hold": ChannelChatUserMessageHold
6
+ }
7
+ }
8
+
9
+ /** Channel Chat User Message Hold v1: When the user's message is caught by automod. */
10
+ type ChannelChatUserMessageHold = EventConfig<{
11
+ Type: "channel.chat.user_message_hold"
12
+ Version: "1"
13
+ /** The conditions to listen for when the user's message is caught by automod. */
14
+ Condition: {
15
+ /** User ID of the channel to receive chat message events for. */
16
+ broadcaster_user_id: string
17
+ /** The user ID to read chat as. */
18
+ user_id: string
19
+ }
20
+ /** The event fired when the user's message is caught by automod. */
21
+ Event: {
22
+ /** The ID of the broadcaster specified in the request. */
23
+ broadcaster_user_id: string
24
+ /** The login of the broadcaster specified in the request. */
25
+ broadcaster_user_login: string
26
+ /** The user name of the broadcaster specified in the request. */
27
+ broadcaster_user_name: string
28
+ /** The User ID of the message sender. */
29
+ user_id: string
30
+ /** The message sender's login. */
31
+ user_login: string
32
+ /** The message sender's display name. */
33
+ user_name: string
34
+ /** The ID of the message that was flagged by automod. */
35
+ message_id: string
36
+ /** The body of the message. */
37
+ message: {
38
+ /** The contents of the message caught by automod. */
39
+ text: string
40
+ /** Ordered list of chat message fragments. */
41
+ fragments: Array<{
42
+ /** Message text in a fragment. */
43
+ text: string
44
+ /** Metadata pertaining to the emote. */
45
+ emote?: {
46
+ /** An ID that uniquely identifies this emote. */
47
+ id: string
48
+ /** An ID that identifies the emote set that the emote belongs to. */
49
+ emote_set_id: string
50
+ }
51
+ /** Metadata pertaining to the cheermote. */
52
+ cheermote?: {
53
+ /** The name portion of the Cheermote string that you use in chat to cheer Bits. The full Cheermote string is the concatenation of {prefix} + {number of Bits}. */
54
+ prefix: string
55
+ /** The amount of Bits cheered. */
56
+ bits: number
57
+ /** The tier level of the cheermote. */
58
+ tier: number
59
+ }
60
+ }>
61
+ }
62
+ }
63
+ }>
64
+
65
+ registerEvent("channel.chat.user_message_hold", {
66
+ scopes: ["user:read:chat"],
67
+ subscriber: (userId) => ({
68
+ type: "channel.chat.user_message_hold",
69
+ version: "1",
70
+ condition: {
71
+ broadcaster_user_id: userId,
72
+ user_id: userId,
73
+ },
74
+ }),
75
+ })
@@ -0,0 +1,82 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.chat.user_message_update": ChannelChatUserMessageUpdate
6
+ }
7
+ }
8
+
9
+ /** Channel Chat User Message Update v1: When the user's message's automod status is updated. */
10
+ type ChannelChatUserMessageUpdate = EventConfig<{
11
+ Type: "channel.chat.user_message_update"
12
+ Version: "1"
13
+ /** The conditions to listen for when the user's message's automod status is updated. */
14
+ Condition: {
15
+ /** User ID of the channel to receive chat message events for. */
16
+ broadcaster_user_id: string
17
+ /** The user ID to read chat as. */
18
+ user_id: string
19
+ }
20
+ /** The event fired when the user's message's automod status is updated. */
21
+ Event: {
22
+ /** The ID of the broadcaster specified in the request. */
23
+ broadcaster_user_id: string
24
+ /** The login of the broadcaster specified in the request. */
25
+ broadcaster_user_login: string
26
+ /** The user name of the broadcaster specified in the request. */
27
+ broadcaster_user_name: string
28
+ /** The User ID of the message sender. */
29
+ user_id: string
30
+ /** The message sender's login. */
31
+ user_login: string
32
+ /** The message sender's user name. */
33
+ user_name: string
34
+ /**
35
+ * The message's status. Possible values are:
36
+ * - approved
37
+ * - denied
38
+ * - invalid
39
+ */
40
+ status: string
41
+ /** The ID of the message that was flagged by automod. */
42
+ message_id: string
43
+ /** The body of the message. */
44
+ message: {
45
+ /** The contents of the message caught by automod. */
46
+ text: string
47
+ /** Ordered list of chat message fragments. */
48
+ fragments: Array<{
49
+ /** Message text in a fragment. */
50
+ text: string
51
+ /** Metadata pertaining to the emote. */
52
+ emote?: {
53
+ /** An ID that uniquely identifies this emote. */
54
+ id: string
55
+ /** An ID that identifies the emote set that the emote belongs to. */
56
+ emote_set_id: string
57
+ }
58
+ /** Metadata pertaining to the cheermote. */
59
+ cheermote?: {
60
+ /** The name portion of the Cheermote string that you use in chat to cheer Bits. The full Cheermote string is the concatenation of {prefix} + {number of Bits}. */
61
+ prefix: string
62
+ /** The amount of Bits cheered. */
63
+ bits: number
64
+ /** The tier level of the cheermote. */
65
+ tier: number
66
+ }
67
+ }>
68
+ }
69
+ }
70
+ }>
71
+
72
+ registerEvent("channel.chat.user_message_update", {
73
+ scopes: ["user:read:chat"],
74
+ subscriber: (userId) => ({
75
+ type: "channel.chat.user_message_update",
76
+ version: "1",
77
+ condition: {
78
+ broadcaster_user_id: userId,
79
+ user_id: userId,
80
+ },
81
+ }),
82
+ })
@@ -0,0 +1,83 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.chat_settings.update": ChannelChatSettingsUpdate
6
+ }
7
+ }
8
+
9
+ /** Channel Chat Settings Update v1: When the broadcaster's chat settings are updated. */
10
+ type ChannelChatSettingsUpdate = EventConfig<{
11
+ Type: "channel.chat_settings.update"
12
+ Version: "1"
13
+ /** The conditions to listen for when the broadcaster's chat settings are updated. */
14
+ Condition: {
15
+ /** User ID of the channel to receive chat settings update events for. */
16
+ broadcaster_user_id: string
17
+ /** The user ID to read chat as. */
18
+ user_id: string
19
+ }
20
+ /** The event fired when the broadcaster's chat settings are updated. */
21
+ Event: {
22
+ /** The ID of the broadcaster specified in the request. */
23
+ broadcaster_user_id: string
24
+ /** The login of the broadcaster specified in the request. */
25
+ broadcaster_user_login: string
26
+ /** The user name of the broadcaster specified in the request. */
27
+ broadcaster_user_name: string
28
+ /** A Boolean value that determines whether chat messages must contain only emotes. True if only messages that are 100% emotes are allowed; otherwise false. */
29
+ emote_mode: boolean
30
+ /**
31
+ * A Boolean value that determines whether the broadcaster restricts the chat room to followers only, based on how long they've followed.
32
+ *
33
+ * True if the broadcaster restricts the chat room to followers only; otherwise false.
34
+ *
35
+ * See follower_mode_duration_minutes for how long the followers must have followed the broadcaster to participate in the chat room.
36
+ */
37
+ follower_mode: boolean
38
+ /**
39
+ * The length of time, in minutes, that the followers must have followed the broadcaster to participate in the chat room. See follower_mode.
40
+ *
41
+ * Null if follower_mode is false.
42
+ */
43
+ follower_mode_duration_minutes: number
44
+ /**
45
+ * A Boolean value that determines whether the broadcaster limits how often users in the chat room are allowed to send messages.
46
+ *
47
+ * Is true, if the broadcaster applies a delay; otherwise, false.
48
+ *
49
+ * See slow_mode_wait_time_seconds for the delay.
50
+ */
51
+ slow_mode: boolean
52
+ /**
53
+ * The amount of time, in seconds, that users need to wait between sending messages. See slow_mode.
54
+ *
55
+ * Null if slow_mode is false.
56
+ */
57
+ slow_mode_wait_time_seconds: number
58
+ /**
59
+ * A Boolean value that determines whether only users that subscribe to the broadcaster's channel can talk in the chat room.
60
+ *
61
+ * True if the broadcaster restricts the chat room to subscribers only; otherwise false.
62
+ */
63
+ subscriber_mode: boolean
64
+ /**
65
+ * A Boolean value that determines whether the broadcaster requires users to post only unique messages in the chat room.
66
+ *
67
+ * True if the broadcaster requires unique messages only; otherwise false.
68
+ */
69
+ unique_chat_mode: boolean
70
+ }
71
+ }>
72
+
73
+ registerEvent("channel.chat_settings.update", {
74
+ scopes: ["user:read:chat"],
75
+ subscriber: (userId) => ({
76
+ type: "channel.chat_settings.update",
77
+ version: "1",
78
+ condition: {
79
+ broadcaster_user_id: userId,
80
+ user_id: userId,
81
+ },
82
+ }),
83
+ })
@@ -0,0 +1,50 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.cheer": ChannelCheer
6
+ }
7
+ }
8
+
9
+ /** Channel Cheer v1: When a user cheers on the specified channel. */
10
+ type ChannelCheer = EventConfig<{
11
+ Type: "channel.cheer"
12
+ Version: "1"
13
+ /** The conditions to listen for when a user cheers on the specified channel. */
14
+ Condition: {
15
+ /** The broadcaster user ID for the channel you want to get cheer notifications for. */
16
+ broadcaster_user_id: string
17
+ }
18
+ /** The event fired when a user cheers on the specified channel. */
19
+ Event: {
20
+ /** Whether the user cheered anonymously or not. */
21
+ is_anonymous: boolean
22
+ /** The user ID for the user who cheered on the specified channel. This is null if is_anonymous is true. */
23
+ user_id: string
24
+ /** The user login for the user who cheered on the specified channel. This is null if is_anonymous is true. */
25
+ user_login: string
26
+ /** The user display name for the user who cheered on the specified channel. This is null if is_anonymous is true. */
27
+ user_name: string
28
+ /** The requested broadcaster ID. */
29
+ broadcaster_user_id: string
30
+ /** The requested broadcaster login. */
31
+ broadcaster_user_login: string
32
+ /** The requested broadcaster display name. */
33
+ broadcaster_user_name: string
34
+ /** The message sent with the cheer. */
35
+ message: string
36
+ /** The number of Bits cheered. */
37
+ bits: number
38
+ }
39
+ }>
40
+
41
+ registerEvent("channel.cheer", {
42
+ scopes: ["bits:read"],
43
+ subscriber: (userId) => ({
44
+ type: "channel.cheer",
45
+ version: "1",
46
+ condition: {
47
+ broadcaster_user_id: userId,
48
+ },
49
+ }),
50
+ })
@@ -0,0 +1,49 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.follow": ChannelFollow
6
+ }
7
+ }
8
+
9
+ /** Channel Follow v2: When the specified channel receives a follow. */
10
+ type ChannelFollow = EventConfig<{
11
+ Type: "channel.follow"
12
+ Version: "2"
13
+ /** The conditions to listen for when the specified channel receives a follow. */
14
+ Condition: {
15
+ /** The broadcaster user ID for the channel you want to get follow notifications for. */
16
+ broadcaster_user_id: string
17
+ /** The ID of the moderator of the channel you want to get follow notifications for. If you have authorization from the broadcaster rather than a moderator, specify the broadcaster's user ID here. */
18
+ moderator_user_id: string
19
+ }
20
+ /** The event fired when the specified channel receives a follow. */
21
+ Event: {
22
+ /** The user ID for the user now following the specified channel. */
23
+ user_id: string
24
+ /** The user login for the user now following the specified channel. */
25
+ user_login: string
26
+ /** The user display name for the user now following the specified channel. */
27
+ user_name: string
28
+ /** The requested broadcaster ID. */
29
+ broadcaster_user_id: string
30
+ /** The requested broadcaster login. */
31
+ broadcaster_user_login: string
32
+ /** The requested broadcaster display name. */
33
+ broadcaster_user_name: string
34
+ /** RFC3339 timestamp of when the follow occurred. */
35
+ followed_at: string
36
+ }
37
+ }>
38
+
39
+ registerEvent("channel.follow", {
40
+ scopes: ["moderator:read:followers"],
41
+ subscriber: (userId) => ({
42
+ type: "channel.follow",
43
+ version: "2",
44
+ condition: {
45
+ broadcaster_user_id: userId,
46
+ moderator_user_id: userId,
47
+ },
48
+ }),
49
+ })