@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,51 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.shoutout.receive": ChannelShoutoutReceive
6
+ }
7
+ }
8
+
9
+ /** Channel Shoutout Receive v1: When the specified broadcaster receives a Shoutout. */
10
+ type ChannelShoutoutReceive = EventConfig<{
11
+ Type: "channel.shoutout.receive"
12
+ Version: "1"
13
+ /** The conditions to listen for when the specified broadcaster receives a Shoutout. */
14
+ Condition: {
15
+ /** The ID of the broadcaster that you want to receive notifications about when they receive a Shoutout. */
16
+ broadcaster_user_id: string
17
+ /** The ID of the broadcaster that received the Shoutout or one of the broadcaster's moderators. */
18
+ moderator_user_id: string
19
+ }
20
+ /** The event fired when the specified broadcaster receives a Shoutout. */
21
+ Event: {
22
+ /** An ID that identifies the broadcaster that received the Shoutout. */
23
+ broadcaster_user_id: string
24
+ /** The broadcaster's login name. */
25
+ broadcaster_user_login: string
26
+ /** The broadcaster's display name. */
27
+ broadcaster_user_name: string
28
+ /** An ID that identifies the broadcaster that sent the Shoutout. */
29
+ from_broadcaster_user_id: string
30
+ /** The broadcaster's login name. */
31
+ from_broadcaster_user_login: string
32
+ /** The broadcaster's display name. */
33
+ from_broadcaster_user_name: string
34
+ /** The number of users that were watching the from-broadcaster's stream at the time of the Shoutout. */
35
+ viewer_count: number
36
+ /** The UTC timestamp (in RFC3339 format) of when the moderator sent the Shoutout. */
37
+ started_at: string
38
+ }
39
+ }>
40
+
41
+ registerEvent("channel.shoutout.receive", {
42
+ scopes: ["moderator:manage:shoutouts", "moderator:read:shoutouts"],
43
+ subscriber: (userId) => ({
44
+ type: "channel.shoutout.receive",
45
+ version: "1",
46
+ condition: {
47
+ broadcaster_user_id: userId,
48
+ moderator_user_id: userId,
49
+ },
50
+ }),
51
+ })
@@ -0,0 +1,48 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.subscribe": ChannelSubscribe
6
+ }
7
+ }
8
+
9
+ /** Channel Subscribe v1: When the specified channel receives a subscriber. This does not include resubscribes. */
10
+ type ChannelSubscribe = EventConfig<{
11
+ Type: "channel.subscribe"
12
+ Version: "1"
13
+ /** The conditions to listen for when the specified channel receives a subscriber. This does not include resubscribes. */
14
+ Condition: {
15
+ /** The broadcaster user ID for the channel you want to get subscribe notifications for. */
16
+ broadcaster_user_id: string
17
+ }
18
+ /** The event fired when the specified channel receives a subscriber. This does not include resubscribes. */
19
+ Event: {
20
+ /** The user ID for the user who subscribed to the specified channel. */
21
+ user_id: string
22
+ /** The user login for the user who subscribed to the specified channel. */
23
+ user_login: string
24
+ /** The user display name for the user who subscribed to the specified channel. */
25
+ user_name: string
26
+ /** The requested broadcaster ID. */
27
+ broadcaster_user_id: string
28
+ /** The requested broadcaster login. */
29
+ broadcaster_user_login: string
30
+ /** The requested broadcaster display name. */
31
+ broadcaster_user_name: string
32
+ /** The tier of the subscription. Valid values are 1000, 2000, and 3000. */
33
+ tier: string
34
+ /** Whether the subscription is a gift. */
35
+ is_gift: boolean
36
+ }
37
+ }>
38
+
39
+ registerEvent("channel.subscribe", {
40
+ scopes: ["channel:read:subscriptions"],
41
+ subscriber: (userId) => ({
42
+ type: "channel.subscribe",
43
+ version: "1",
44
+ condition: {
45
+ broadcaster_user_id: userId,
46
+ },
47
+ }),
48
+ })
@@ -0,0 +1,48 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.subscription.end": ChannelSubscriptionEnd
6
+ }
7
+ }
8
+
9
+ /** Channel Subscription End v1: When a subscription to the specified channel ends. */
10
+ type ChannelSubscriptionEnd = EventConfig<{
11
+ Type: "channel.subscription.end"
12
+ Version: "1"
13
+ /** The conditions to listen for when a subscription to the specified channel ends. */
14
+ Condition: {
15
+ /** The broadcaster user ID for the channel you want to get subscription end notifications for. */
16
+ broadcaster_user_id: string
17
+ }
18
+ /** The event fired when a subscription to the specified channel ends. */
19
+ Event: {
20
+ /** The user ID for the user whose subscription ended. */
21
+ user_id: string
22
+ /** The user login for the user whose subscription ended. */
23
+ user_login: string
24
+ /** The user display name for the user whose subscription ended. */
25
+ user_name: string
26
+ /** The broadcaster user ID. */
27
+ broadcaster_user_id: string
28
+ /** The broadcaster login. */
29
+ broadcaster_user_login: string
30
+ /** The broadcaster display name. */
31
+ broadcaster_user_name: string
32
+ /** The tier of the subscription that ended. Valid values are 1000, 2000, and 3000. */
33
+ tier: string
34
+ /** Whether the subscription was a gift. */
35
+ is_gift: boolean
36
+ }
37
+ }>
38
+
39
+ registerEvent("channel.subscription.end", {
40
+ scopes: ["channel:read:subscriptions"],
41
+ subscriber: (userId) => ({
42
+ type: "channel.subscription.end",
43
+ version: "1",
44
+ condition: {
45
+ broadcaster_user_id: userId,
46
+ },
47
+ }),
48
+ })
@@ -0,0 +1,52 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.subscription.gift": ChannelSubscriptionGift
6
+ }
7
+ }
8
+
9
+ /** Channel Subscription Gift v1: When a viewer gives a gift subscription to one or more users in the specified channel. */
10
+ type ChannelSubscriptionGift = EventConfig<{
11
+ Type: "channel.subscription.gift"
12
+ Version: "1"
13
+ /** The conditions to listen for when a viewer gives a gift subscription to one or more users in the specified channel. */
14
+ Condition: {
15
+ /** The broadcaster user ID for the channel you want to get subscription gift notifications for. */
16
+ broadcaster_user_id: string
17
+ }
18
+ /** The event fired when a viewer gives a gift subscription to one or more users in the specified channel. */
19
+ Event: {
20
+ /** The user ID of the user who sent the subscription gift. Set to null if it was an anonymous subscription gift. */
21
+ user_id: string
22
+ /** The user login of the user who sent the gift. Set to null if it was an anonymous subscription gift. */
23
+ user_login: string
24
+ /** The user display name of the user who sent the gift. Set to null if it was an anonymous subscription gift. */
25
+ user_name: string
26
+ /** The broadcaster user ID. */
27
+ broadcaster_user_id: string
28
+ /** The broadcaster login. */
29
+ broadcaster_user_login: string
30
+ /** The broadcaster display name. */
31
+ broadcaster_user_name: string
32
+ /** The number of subscriptions in the subscription gift. */
33
+ total: number
34
+ /** The tier of subscriptions in the subscription gift. */
35
+ tier: string
36
+ /** The number of subscriptions gifted by this user in the channel. This value is null for anonymous gifts or if the gifter has opted out of sharing this information. */
37
+ cumulative_total: number
38
+ /** Whether the subscription gift was anonymous. */
39
+ is_anonymous: boolean
40
+ }
41
+ }>
42
+
43
+ registerEvent("channel.subscription.gift", {
44
+ scopes: ["channel:read:subscriptions"],
45
+ subscriber: (userId) => ({
46
+ type: "channel.subscription.gift",
47
+ version: "1",
48
+ condition: {
49
+ broadcaster_user_id: userId,
50
+ },
51
+ }),
52
+ })
@@ -0,0 +1,66 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.subscription.message": ChannelSubscriptionMessage
6
+ }
7
+ }
8
+
9
+ /** Channel Subscription Message v1: When a user sends a resubscription chat message in a specific channel. */
10
+ type ChannelSubscriptionMessage = EventConfig<{
11
+ Type: "channel.subscription.message"
12
+ Version: "1"
13
+ /** The conditions to listen for when a user sends a resubscription chat message in a specific channel. */
14
+ Condition: {
15
+ /** The broadcaster user ID for the channel you want to get resubscription chat message notifications for. */
16
+ broadcaster_user_id: string
17
+ }
18
+ /** The event fired when a user sends a resubscription chat message in a specific channel. */
19
+ Event: {
20
+ /** The user ID of the user who sent a resubscription chat message. */
21
+ user_id: string
22
+ /** The user login of the user who sent a resubscription chat message. */
23
+ user_login: string
24
+ /** The user display name of the user who a resubscription chat message. */
25
+ user_name: string
26
+ /** The broadcaster user ID. */
27
+ broadcaster_user_id: string
28
+ /** The broadcaster login. */
29
+ broadcaster_user_login: string
30
+ /** The broadcaster display name. */
31
+ broadcaster_user_name: string
32
+ /** The tier of the user's subscription. */
33
+ tier: string
34
+ /** An object that contains the resubscription message and emote information needed to recreate the message. */
35
+ message: {
36
+ /** The text of the resubscription chat message. */
37
+ text: string
38
+ /** An array that includes the emote ID and start and end positions for where the emote appears in the text. */
39
+ emotes: {
40
+ /** The index of where the Emote starts in the text. */
41
+ begin: number
42
+ /** The index of where the Emote ends in the text. */
43
+ end: number
44
+ /** The emote ID. */
45
+ id: string
46
+ }
47
+ }
48
+ /** The total number of months the user has been subscribed to the channel. */
49
+ cumulative_months: number
50
+ /** The number of consecutive months the user's current subscription has been active. This value is null if the user has opted out of sharing this information. */
51
+ streak_months: number
52
+ /** The month duration of the subscription. */
53
+ duration_months: number
54
+ }
55
+ }>
56
+
57
+ registerEvent("channel.subscription.message", {
58
+ scopes: ["channel:read:subscriptions"],
59
+ subscriber: (userId) => ({
60
+ type: "channel.subscription.message",
61
+ version: "1",
62
+ condition: {
63
+ broadcaster_user_id: userId,
64
+ },
65
+ }),
66
+ })
@@ -0,0 +1,85 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.suspicious_user.message": ChannelSuspiciousUserMessage
6
+ }
7
+ }
8
+
9
+ /** Channel Suspicious User Message v1: When a chat message has been sent by a suspicious user. */
10
+ type ChannelSuspiciousUserMessage = EventConfig<{
11
+ Type: "channel.suspicious_user.message"
12
+ Version: "1"
13
+ /** The conditions to listen for when a chat message has been sent by a suspicious user. */
14
+ Condition: {
15
+ /** The ID of a user that has permission to moderate the broadcaster's channel and has granted your app permission to subscribe to this subscription type. */
16
+ moderator_user_id: string
17
+ /** User ID of the channel to receive chat message events for. */
18
+ broadcaster_user_id: string
19
+ }
20
+ /** The event fired when a chat message has been sent by a suspicious user. */
21
+ Event: {
22
+ /** The ID of the channel where the treatment for a suspicious user was updated. */
23
+ broadcaster_user_id: string
24
+ /** The display name of the channel where the treatment for a suspicious user was updated. */
25
+ broadcaster_user_name: string
26
+ /** The login of the channel where the treatment for a suspicious user was updated. */
27
+ broadcaster_user_login: string
28
+ /** The user ID of the user that sent the message. */
29
+ user_id: string
30
+ /** The user name of the user that sent the message. */
31
+ user_name: string
32
+ /** The user login of the user that sent the message. */
33
+ user_login: string
34
+ /** The status set for the suspicious user. Can be the following: "none", "active_monitoring", or "restricted" */
35
+ low_trust_status: string
36
+ /** A list of channel IDs where the suspicious user is also banned. */
37
+ shared_ban_channel_ids: string[]
38
+ /** User types (if any) that apply to the suspicious user, can be "manually_added", "ban_evader", or "banned_in_shared_channel". */
39
+ types: string[]
40
+ /** A ban evasion likelihood value (if any) that as been applied to the user automatically by Twitch, can be "unknown", "possible", or "likely". */
41
+ ban_evasion_evaluation: string
42
+ /** The structured chat message. */
43
+ message: {
44
+ /** The UUID that identifies the message. */
45
+ message_id: string
46
+ /** The chat message in plain text. */
47
+ text: string
48
+ /** Ordered list of chat message fragments. */
49
+ fragments: Array<{
50
+ /** The type of message fragment. Possible values: -text -cheermote -emote */
51
+ type: string
52
+ /** Message text in fragment. */
53
+ text: string
54
+ /** Metadata pertaining to the cheermote. */
55
+ cheermote?: {
56
+ /** 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}. */
57
+ prefix: string
58
+ /** The amount of Bits cheered. */
59
+ bits: string
60
+ /** The tier level of the cheermote. */
61
+ tier: string
62
+ }
63
+ /** Metadata pertaining to the emote. */
64
+ emote?: {
65
+ /** An ID that uniquely identifies this emote. */
66
+ id: string
67
+ /** An ID that identifies the emote set that the emote belongs to. */
68
+ emote_set_id: string
69
+ }
70
+ }>
71
+ }
72
+ }
73
+ }>
74
+
75
+ registerEvent("channel.suspicious_user.message", {
76
+ scopes: ["moderator:read:suspicious"],
77
+ subscriber: (userId) => ({
78
+ type: "channel.suspicious_user.message",
79
+ version: "1",
80
+ condition: {
81
+ moderator_user_id: userId,
82
+ broadcaster_user_id: userId,
83
+ },
84
+ }),
85
+ })
@@ -0,0 +1,55 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.suspicious_user.update": ChannelSuspiciousUserUpdate
6
+ }
7
+ }
8
+
9
+ /** Channel Suspicious User Update v1: When a suspicious user has been updated. */
10
+ type ChannelSuspiciousUserUpdate = EventConfig<{
11
+ Type: "channel.suspicious_user.update"
12
+ Version: "1"
13
+ /** The conditions to listen for when a suspicious user has been updated. */
14
+ Condition: {
15
+ /** The ID of a user that has permission to moderate the broadcaster's channel and has granted your app permission to subscribe to this subscription type. */
16
+ moderator_user_id: string
17
+ /** The broadcaster you want to get chat unban request notifications for. */
18
+ broadcaster_user_id: string
19
+ }
20
+ /** The event fired when a suspicious user has been updated. */
21
+ Event: {
22
+ /** The ID of the channel where the treatment for a suspicious user was updated. */
23
+ broadcaster_user_id: string
24
+ /** The display name of the channel where the treatment for a suspicious user was updated. */
25
+ broadcaster_user_name: string
26
+ /** The Login of the channel where the treatment for a suspicious user was updated. */
27
+ broadcaster_user_login: string
28
+ /** The ID of the moderator that updated the treatment for a suspicious user. */
29
+ moderator_user_id: string
30
+ /** The display name of the moderator that updated the treatment for a suspicious user. */
31
+ moderator_user_name: string
32
+ /** The login of the moderator that updated the treatment for a suspicious user. */
33
+ moderator_user_login: string
34
+ /** The ID of the suspicious user whose treatment was updated. */
35
+ user_id: string
36
+ /** The display name of the suspicious user whose treatment was updated. */
37
+ user_name: string
38
+ /** The login of the suspicious user whose treatment was updated. */
39
+ user_login: string
40
+ /** The status set for the suspicious user. Can be the following: "none", "active_monitoring", or "restricted". */
41
+ low_trust_status: string
42
+ }
43
+ }>
44
+
45
+ registerEvent("channel.suspicious_user.update", {
46
+ scopes: ["moderator:read:suspicious"],
47
+ subscriber: (userId) => ({
48
+ type: "channel.suspicious_user.update",
49
+ version: "1",
50
+ condition: {
51
+ moderator_user_id: userId,
52
+ broadcaster_user_id: userId,
53
+ },
54
+ }),
55
+ })
@@ -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.unban": ChannelUnban
6
+ }
7
+ }
8
+
9
+ /** Channel Unban v1: When a viewer is unbanned from the specified channel. */
10
+ type ChannelUnban = EventConfig<{
11
+ Type: "channel.unban"
12
+ Version: "1"
13
+ /** The conditions to listen for when a viewer is unbanned from the specified channel. */
14
+ Condition: {
15
+ /** The broadcaster user ID for the channel you want to get unban notifications for. */
16
+ broadcaster_user_id: string
17
+ }
18
+ /** The event fired when a viewer is unbanned from the specified channel. */
19
+ Event: {
20
+ /** The user id for the user who was unbanned on the specified channel. */
21
+ user_id: string
22
+ /** The user login for the user who was unbanned on the specified channel. */
23
+ user_login: string
24
+ /** The user display name for the user who was unbanned on the specified channel. */
25
+ user_name: string
26
+ /** The requested broadcaster ID. */
27
+ broadcaster_user_id: string
28
+ /** The requested broadcaster login. */
29
+ broadcaster_user_login: string
30
+ /** The requested broadcaster display name. */
31
+ broadcaster_user_name: string
32
+ /** The user ID of the issuer of the unban. */
33
+ moderator_user_id: string
34
+ /** The user login of the issuer of the unban. */
35
+ moderator_user_login: string
36
+ /** The user name of the issuer of the unban. */
37
+ moderator_user_name: string
38
+ }
39
+ }>
40
+
41
+ registerEvent("channel.unban", {
42
+ scopes: ["channel:moderate"],
43
+ subscriber: (userId) => ({
44
+ type: "channel.unban",
45
+ version: "1",
46
+ condition: {
47
+ broadcaster_user_id: userId,
48
+ },
49
+ }),
50
+ })
@@ -0,0 +1,53 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.unban_request.create": ChannelUnbanRequestCreate
6
+ }
7
+ }
8
+
9
+ /** Channel Unban Request Create v1: When a user creates an unban request. */
10
+ type ChannelUnbanRequestCreate = EventConfig<{
11
+ Type: "channel.unban_request.create"
12
+ Version: "1"
13
+ /** The conditions to listen for when a user creates an unban request. */
14
+ Condition: {
15
+ /** The ID of the user that has permission to moderate the broadcaster's channel and has granted your app permission to subscribe to this subscription type. */
16
+ moderator_user_id: string
17
+ /** The ID of the broadcaster you want to get chat unban request notifications for. Maximum: 1. */
18
+ broadcaster_user_id: string
19
+ }
20
+ /** The event fired when a user creates an unban request. */
21
+ Event: {
22
+ /** The ID of the unban request. */
23
+ id: string
24
+ /** The broadcaster's user ID for the channel the unban request was created for. */
25
+ broadcaster_user_id: string
26
+ /** The broadcaster's login name. */
27
+ broadcaster_user_login: string
28
+ /** The broadcaster's display name. */
29
+ broadcaster_user_name: string
30
+ /** User ID of user that is requesting to be unbanned. */
31
+ user_id: string
32
+ /** The user's login name. */
33
+ user_login: string
34
+ /** The user's display name. */
35
+ user_name: string
36
+ /** Message sent in the unban request. */
37
+ text: string
38
+ /** The UTC timestamp (in RFC3339 format) of when the unban request was created. */
39
+ created_at: string
40
+ }
41
+ }>
42
+
43
+ registerEvent("channel.unban_request.create", {
44
+ scopes: ["moderator:manage:unban", "moderator:read:unban"],
45
+ subscriber: (userId) => ({
46
+ type: "channel.unban_request.create",
47
+ version: "1",
48
+ condition: {
49
+ moderator_user_id: userId,
50
+ broadcaster_user_id: userId,
51
+ },
52
+ }),
53
+ })
@@ -0,0 +1,64 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.unban_request.resolve": ChannelUnbanRequestResolve
6
+ }
7
+ }
8
+
9
+ /** Channel Unban Request Resolve v1: When an unban request has been resolved. */
10
+ type ChannelUnbanRequestResolve = EventConfig<{
11
+ Type: "channel.unban_request.resolve"
12
+ Version: "1"
13
+ /** The conditions to listen for when an unban request has been resolved. */
14
+ Condition: {
15
+ /** The ID of the user that has permission to moderate the broadcaster's channel and has granted your app permission to subscribe to this subscription type. */
16
+ moderator_user_id: string
17
+ /** The ID of the broadcaster you want to get unban request resolution notifications for. Maximum: 1. */
18
+ broadcaster_user_id: string
19
+ }
20
+ /** The event fired when an unban request has been resolved. */
21
+ Event: {
22
+ /** The ID of the unban request. */
23
+ id: string
24
+ /** The broadcaster's user ID for the channel the unban request was updated for. */
25
+ broadcaster_user_id: string
26
+ /** The broadcaster's login name. */
27
+ broadcaster_user_login: string
28
+ /** The broadcaster's display name. */
29
+ broadcaster_user_name: string
30
+ /** User ID of moderator who approved/denied the request. */
31
+ moderator_id?: string
32
+ /** The moderator's login name */
33
+ moderator_login?: string
34
+ /** The moderator's display name */
35
+ moderator_name?: string
36
+ /** User ID of user that requested to be unbanned. */
37
+ user_id: string
38
+ /** The user's login name. */
39
+ user_login: string
40
+ /** The user's display name. */
41
+ user_name: string
42
+ /** Resolution text supplied by the mod/broadcaster upon approval/denial of the request. */
43
+ resolution_text?: string
44
+ /**
45
+ * Dictates whether the unban request was approved or denied. Can be the following:
46
+ * - approved
47
+ * - canceled
48
+ * - denied
49
+ */
50
+ status: string
51
+ }
52
+ }>
53
+
54
+ registerEvent("channel.unban_request.resolve", {
55
+ scopes: ["moderator:manage:unban", "moderator:read:unban"],
56
+ subscriber: (userId) => ({
57
+ type: "channel.unban_request.resolve",
58
+ version: "1",
59
+ condition: {
60
+ moderator_user_id: userId,
61
+ broadcaster_user_id: userId,
62
+ },
63
+ }),
64
+ })
@@ -0,0 +1,48 @@
1
+ import { type EventConfig, registerEvent } from "../events-helpers.ts"
2
+
3
+ declare module "../events-helpers.ts" {
4
+ interface EventConfigs {
5
+ "channel.update": ChannelUpdate
6
+ }
7
+ }
8
+
9
+ /** Channel Update v2: When the broadcaster updates their channel properties e.g., category, title, content classification labels, broadcast, or language. */
10
+ type ChannelUpdate = EventConfig<{
11
+ Type: "channel.update"
12
+ Version: "2"
13
+ /** The conditions to listen for when the broadcaster updates their channel properties e.g., category, title, content classification labels, broadcast, or language. */
14
+ Condition: {
15
+ /** The broadcaster user ID for the channel you want to get updates for. */
16
+ broadcaster_user_id: string
17
+ }
18
+ /** The event fired when the broadcaster updates their channel properties e.g., category, title, content classification labels, broadcast, or language. */
19
+ Event: {
20
+ /** The broadcaster's user ID. */
21
+ broadcaster_user_id: string
22
+ /** The broadcaster's user login. */
23
+ broadcaster_user_login: string
24
+ /** The broadcaster's user display name. */
25
+ broadcaster_user_name: string
26
+ /** The channel's stream title. */
27
+ title: string
28
+ /** The channel's broadcast language. */
29
+ language: string
30
+ /** The channel's category ID. */
31
+ category_id: string
32
+ /** The category name. */
33
+ category_name: string
34
+ /** Array of content classification label IDs currently applied on the Channel. To retrieve a list of all possible IDs, use the "Get Content Classification Labels" API endpoint. */
35
+ content_classification_labels: string[]
36
+ }
37
+ }>
38
+
39
+ registerEvent("channel.update", {
40
+ scopes: [],
41
+ subscriber: (userId) => ({
42
+ type: "channel.update",
43
+ version: "2",
44
+ condition: {
45
+ broadcaster_user_id: userId,
46
+ },
47
+ }),
48
+ })
@@ -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.vip.add": ChannelVipAdd
6
+ }
7
+ }
8
+
9
+ /** Channel Vip Add v1: When a VIP is added to the channel. */
10
+ type ChannelVipAdd = EventConfig<{
11
+ Type: "channel.vip.add"
12
+ Version: "1"
13
+ /** The conditions to listen for when a VIP is added to the channel. */
14
+ Condition: {
15
+ /** The User ID of the broadcaster (channel) Maximum: 1 */
16
+ broadcaster_user_id: string
17
+ }
18
+ /** The event fired when a VIP is added to the channel. */
19
+ Event: {
20
+ /** The ID of the user who was added as a VIP. */
21
+ user_id: string
22
+ /** The login of the user who was added as a VIP. */
23
+ user_login: string
24
+ /** The display name of the user who was added as a VIP. */
25
+ user_name: string
26
+ /** The ID of the broadcaster. */
27
+ broadcaster_user_id: string
28
+ /** The login of the broadcaster. */
29
+ broadcaster_user_login: string
30
+ /** The display name of the broadcaster. */
31
+ broadcaster_user_name: string
32
+ }
33
+ }>
34
+
35
+ registerEvent("channel.vip.add", {
36
+ scopes: ["channel:manage:vips", "channel:read:vips"],
37
+ subscriber: (userId) => ({
38
+ type: "channel.vip.add",
39
+ version: "1",
40
+ condition: {
41
+ broadcaster_user_id: userId,
42
+ },
43
+ }),
44
+ })