@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.
- package/package.json +2 -2
- package/src/authentication/authentication.ts +1 -1
- package/src/authentication/index.ts +1 -1
- package/src/chat/chat.ts +4 -4
- package/src/chat/helpers.ts +1 -1
- package/src/chat/index.ts +4 -3
- package/src/chat/interfaces/index.ts +2 -2
- package/src/chat/parser.ts +1 -1
- package/src/eventsub/events/automod.message.hold-2.ts +81 -0
- package/src/eventsub/events/automod.message.update-2.ts +94 -0
- package/src/eventsub/events/automod.settings.update-1.ts +65 -0
- package/src/eventsub/events/automod.terms.update-1.ts +59 -0
- package/src/eventsub/events/channel.ad_break.begin-1.ts +50 -0
- package/src/eventsub/events/channel.ban-1.ts +58 -0
- package/src/eventsub/events/channel.bits.use-1.ts +112 -0
- package/src/eventsub/events/channel.channel_points_automatic_reward_redemption.add-2.ts +88 -0
- package/src/eventsub/events/channel.channel_points_custom_reward.add-1.ts +101 -0
- package/src/eventsub/events/channel.channel_points_custom_reward.remove-1.ts +103 -0
- package/src/eventsub/events/channel.channel_points_custom_reward.update-1.ts +103 -0
- package/src/eventsub/events/channel.channel_points_custom_reward_redemption.add-1.ts +65 -0
- package/src/eventsub/events/channel.channel_points_custom_reward_redemption.update-1.ts +65 -0
- package/src/eventsub/events/channel.charity_campaign.donate-1.ts +69 -0
- package/src/eventsub/events/channel.charity_campaign.progress-1.ts +74 -0
- package/src/eventsub/events/channel.charity_campaign.start-1.ts +76 -0
- package/src/eventsub/events/channel.charity_campaign.stop-1.ts +76 -0
- package/src/eventsub/events/channel.chat.clear-1.ts +41 -0
- package/src/eventsub/events/channel.chat.clear_user_messages-1.ts +47 -0
- package/src/eventsub/events/channel.chat.message-1.ts +160 -0
- package/src/eventsub/events/channel.chat.message_delete-1.ts +49 -0
- package/src/eventsub/events/channel.chat.notification-1.ts +317 -0
- package/src/eventsub/events/channel.chat.user_message_hold-1.ts +75 -0
- package/src/eventsub/events/channel.chat.user_message_update-1.ts +82 -0
- package/src/eventsub/events/channel.chat_settings.update-1.ts +83 -0
- package/src/eventsub/events/channel.cheer-1.ts +50 -0
- package/src/eventsub/events/channel.follow-2.ts +49 -0
- package/src/eventsub/events/channel.goal.begin-1.ts +80 -0
- package/src/eventsub/events/channel.goal.end-1.ts +80 -0
- package/src/eventsub/events/channel.goal.progress-1.ts +80 -0
- package/src/eventsub/events/channel.guest_star_guest.update-beta.ts +85 -0
- package/src/eventsub/events/channel.guest_star_session.begin-beta.ts +50 -0
- package/src/eventsub/events/channel.guest_star_session.end-beta.ts +58 -0
- package/src/eventsub/events/channel.guest_star_settings.update-beta.ts +62 -0
- package/src/eventsub/events/channel.hype_train.begin-2.ts +90 -0
- package/src/eventsub/events/channel.hype_train.end-2.ts +70 -0
- package/src/eventsub/events/channel.hype_train.progress-2.ts +90 -0
- package/src/eventsub/events/channel.moderate-2.ts +258 -0
- package/src/eventsub/events/channel.moderator.add-1.ts +44 -0
- package/src/eventsub/events/channel.moderator.remove-1.ts +44 -0
- package/src/eventsub/events/channel.poll.begin-1.ts +73 -0
- package/src/eventsub/events/channel.poll.end-1.ts +75 -0
- package/src/eventsub/events/channel.poll.progress-1.ts +73 -0
- package/src/eventsub/events/channel.prediction.begin-1.ts +72 -0
- package/src/eventsub/events/channel.prediction.end-1.ts +76 -0
- package/src/eventsub/events/channel.prediction.lock-1.ts +72 -0
- package/src/eventsub/events/channel.prediction.progress-1.ts +72 -0
- package/src/eventsub/events/channel.raid-1.ts +48 -0
- package/src/eventsub/events/channel.shared_chat.begin-1.ts +55 -0
- package/src/eventsub/events/channel.shared_chat.end-1.ts +46 -0
- package/src/eventsub/events/channel.shared_chat.update-1.ts +55 -0
- package/src/eventsub/events/channel.shield_mode.begin-1.ts +51 -0
- package/src/eventsub/events/channel.shield_mode.end-1.ts +51 -0
- package/src/eventsub/events/channel.shoutout.create-1.ts +61 -0
- package/src/eventsub/events/channel.shoutout.receive-1.ts +51 -0
- package/src/eventsub/events/channel.subscribe-1.ts +48 -0
- package/src/eventsub/events/channel.subscription.end-1.ts +48 -0
- package/src/eventsub/events/channel.subscription.gift-1.ts +52 -0
- package/src/eventsub/events/channel.subscription.message-1.ts +66 -0
- package/src/eventsub/events/channel.suspicious_user.message-1.ts +85 -0
- package/src/eventsub/events/channel.suspicious_user.update-1.ts +55 -0
- package/src/eventsub/events/channel.unban-1.ts +50 -0
- package/src/eventsub/events/channel.unban_request.create-1.ts +53 -0
- package/src/eventsub/events/channel.unban_request.resolve-1.ts +64 -0
- package/src/eventsub/events/channel.update-2.ts +48 -0
- package/src/eventsub/events/channel.vip.add-1.ts +44 -0
- package/src/eventsub/events/channel.vip.remove-1.ts +44 -0
- package/src/eventsub/events/channel.warning.acknowledge-1.ts +47 -0
- package/src/eventsub/events/channel.warning.send-1.ts +57 -0
- package/src/eventsub/events/index.ts +73 -284
- package/src/eventsub/events/stream.offline-1.ts +38 -0
- package/src/eventsub/events/stream.online-1.ts +44 -0
- package/src/eventsub/events/user.update-1.ts +48 -0
- package/src/eventsub/events/user.whisper.message-1.ts +51 -0
- package/src/eventsub/events-helpers.ts +53 -25
- package/src/eventsub/eventsub.ts +37 -74
- package/src/eventsub/index.ts +8 -6
- package/src/eventsub/messages.ts +16 -4
- package/src/helix/channel-points/custom-rewards.ts +3 -3
- package/src/helix/channel-points/index.ts +1 -1
- package/src/helix/helix.ts +1 -1
- package/src/helix/subscriptions/index.ts +1 -1
- package/src/helix/subscriptions/subscriptions.ts +40 -47
- package/src/helix/users/index.ts +1 -1
- package/src/helix/users/users.ts +3 -3
- package/src/helpers/alerts/alerts.ts +5 -5
- package/src/helpers/alerts/index.ts +2 -2
- package/src/helpers/charity/charity.ts +2 -2
- package/src/helpers/charity/index.ts +1 -1
- package/src/helpers/goal/goal.ts +2 -2
- package/src/helpers/goal/index.ts +1 -1
- package/src/helpers/hype-train/hype-train.ts +2 -2
- package/src/helpers/hype-train/index.ts +1 -1
- package/src/helpers/poll/index.ts +1 -1
- package/src/helpers/poll/poll.ts +3 -3
- package/src/helpers/prediction/index.ts +1 -1
- package/src/helpers/prediction/prediction.ts +3 -3
- package/src/helpers/redemption/index.ts +1 -1
- package/src/helpers/redemption/redemption.ts +3 -3
- package/src/helpers/status/index.ts +1 -1
- package/src/helpers/status/status.ts +2 -2
- package/src/ui/authentication.ts +1 -1
- package/src/ui/popup.ts +26 -3
- package/src/eventsub/events/channel.ad_break.begin.ts +0 -51
- package/src/eventsub/events/channel.ban.ts +0 -59
- package/src/eventsub/events/channel.channel_points_custom_reward._.ts +0 -29
- package/src/eventsub/events/channel.channel_points_custom_reward.add.ts +0 -75
- package/src/eventsub/events/channel.channel_points_custom_reward.remove.ts +0 -77
- package/src/eventsub/events/channel.channel_points_custom_reward.update.ts +0 -77
- package/src/eventsub/events/channel.channel_points_custom_reward_redemption._.ts +0 -10
- package/src/eventsub/events/channel.channel_points_custom_reward_redemption.add.ts +0 -59
- package/src/eventsub/events/channel.channel_points_custom_reward_redemption.update.ts +0 -59
- package/src/eventsub/events/channel.charity_campaign.donate.ts +0 -66
- package/src/eventsub/events/channel.charity_campaign.progress.ts +0 -67
- package/src/eventsub/events/channel.charity_campaign.start.ts +0 -69
- package/src/eventsub/events/channel.charity_campaign.stop.ts +0 -69
- package/src/eventsub/events/channel.chat.clear.ts +0 -42
- package/src/eventsub/events/channel.chat.clear_user_messages.ts +0 -48
- package/src/eventsub/events/channel.chat.message_delete.ts +0 -50
- package/src/eventsub/events/channel.chat.notification.ts +0 -50
- package/src/eventsub/events/channel.cheer.ts +0 -51
- package/src/eventsub/events/channel.follow.ts +0 -50
- package/src/eventsub/events/channel.goal.begin.ts +0 -51
- package/src/eventsub/events/channel.goal.end.ts +0 -55
- package/src/eventsub/events/channel.goal.progress.ts +0 -51
- package/src/eventsub/events/channel.guest_star_guest.update.ts +0 -66
- package/src/eventsub/events/channel.guest_star_session.begin.ts +0 -46
- package/src/eventsub/events/channel.guest_star_session.end.ts +0 -48
- package/src/eventsub/events/channel.guest_star_settings.update.ts +0 -50
- package/src/eventsub/events/channel.hype_train._.ts +0 -12
- package/src/eventsub/events/channel.hype_train.begin.ts +0 -57
- package/src/eventsub/events/channel.hype_train.end.ts +0 -55
- package/src/eventsub/events/channel.hype_train.progress.ts +0 -70
- package/src/eventsub/events/channel.moderator.add.ts +0 -45
- package/src/eventsub/events/channel.moderator.remove.ts +0 -45
- package/src/eventsub/events/channel.poll._.ts +0 -26
- package/src/eventsub/events/channel.poll.begin.ts +0 -55
- package/src/eventsub/events/channel.poll.end.ts +0 -57
- package/src/eventsub/events/channel.poll.progress.ts +0 -55
- package/src/eventsub/events/channel.prediction._.ts +0 -25
- package/src/eventsub/events/channel.prediction.begin.ts +0 -51
- package/src/eventsub/events/channel.prediction.end.ts +0 -55
- package/src/eventsub/events/channel.prediction.lock.ts +0 -51
- package/src/eventsub/events/channel.prediction.progress.ts +0 -51
- package/src/eventsub/events/channel.raid.ts +0 -49
- package/src/eventsub/events/channel.shield_mode.begin.ts +0 -50
- package/src/eventsub/events/channel.shield_mode.end.ts +0 -50
- package/src/eventsub/events/channel.shoutout.create.ts +0 -62
- package/src/eventsub/events/channel.shoutout.receive.ts +0 -52
- package/src/eventsub/events/channel.subscribe.ts +0 -49
- package/src/eventsub/events/channel.subscription.end.ts +0 -49
- package/src/eventsub/events/channel.subscription.gift.ts +0 -53
- package/src/eventsub/events/channel.subscription.message.ts +0 -67
- package/src/eventsub/events/channel.unban.ts +0 -51
- package/src/eventsub/events/channel.update.ts +0 -49
- package/src/eventsub/events/stream.offline.ts +0 -39
- package/src/eventsub/events/stream.online.ts +0 -45
- package/src/eventsub/events/user.update.ts +0 -45
|
@@ -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.remove": ChannelVipRemove
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Channel Vip Remove v1: When a VIP is removed from the channel. */
|
|
10
|
+
type ChannelVipRemove = EventConfig<{
|
|
11
|
+
Type: "channel.vip.remove"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when a VIP is removed from 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 removed from the channel. */
|
|
19
|
+
Event: {
|
|
20
|
+
/** The ID of the user who was removed as a VIP. */
|
|
21
|
+
user_id: string
|
|
22
|
+
/** The login of the user who was removed as a VIP. */
|
|
23
|
+
user_login: string
|
|
24
|
+
/** The display name of the user who was removed 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.remove", {
|
|
36
|
+
scopes: ["channel:manage:vips", "channel:read:vips"],
|
|
37
|
+
subscriber: (userId) => ({
|
|
38
|
+
type: "channel.vip.remove",
|
|
39
|
+
version: "1",
|
|
40
|
+
condition: {
|
|
41
|
+
broadcaster_user_id: userId,
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
})
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type EventConfig, registerEvent } from "../events-helpers.ts"
|
|
2
|
+
|
|
3
|
+
declare module "../events-helpers.ts" {
|
|
4
|
+
interface EventConfigs {
|
|
5
|
+
"channel.warning.acknowledge": ChannelWarningAcknowledge
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Channel Warning Acknowledge v1: When a user awknowledges a warning. Broadcasters and moderators can see the warning's details. */
|
|
10
|
+
type ChannelWarningAcknowledge = EventConfig<{
|
|
11
|
+
Type: "channel.warning.acknowledge"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when a user awknowledges a warning. Broadcasters and moderators can see the warning's details. */
|
|
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 user awknowledges a warning. Broadcasters and moderators can see the warning's details. */
|
|
21
|
+
Event: {
|
|
22
|
+
/** The user 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 ID of the user that has acknowledged their warning. */
|
|
29
|
+
user_id: string
|
|
30
|
+
/** The login of the user that has acknowledged their warning. */
|
|
31
|
+
user_login: string
|
|
32
|
+
/** The user name of the user that has acknowledged their warning. */
|
|
33
|
+
user_name: string
|
|
34
|
+
}
|
|
35
|
+
}>
|
|
36
|
+
|
|
37
|
+
registerEvent("channel.warning.acknowledge", {
|
|
38
|
+
scopes: ["moderator:manage:warnings", "moderator:read:warnings"],
|
|
39
|
+
subscriber: (userId) => ({
|
|
40
|
+
type: "channel.warning.acknowledge",
|
|
41
|
+
version: "1",
|
|
42
|
+
condition: {
|
|
43
|
+
broadcaster_user_id: userId,
|
|
44
|
+
moderator_user_id: userId,
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
})
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type EventConfig, registerEvent } from "../events-helpers.ts"
|
|
2
|
+
|
|
3
|
+
declare module "../events-helpers.ts" {
|
|
4
|
+
interface EventConfigs {
|
|
5
|
+
"channel.warning.send": ChannelWarningSend
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Channel Warning Send v1: When a user is sent a warning. Broadcasters and moderators can see the warning's details. */
|
|
10
|
+
type ChannelWarningSend = EventConfig<{
|
|
11
|
+
Type: "channel.warning.send"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when a user is sent a warning. Broadcasters and moderators can see the warning's details. */
|
|
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 user is sent a warning. Broadcasters and moderators can see the warning's details. */
|
|
21
|
+
Event: {
|
|
22
|
+
/** The user 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 user ID of the moderator who sent the warning. */
|
|
29
|
+
moderator_user_id: string
|
|
30
|
+
/** The login of the moderator. */
|
|
31
|
+
moderator_user_login: string
|
|
32
|
+
/** The user name of the moderator. */
|
|
33
|
+
moderator_user_name: string
|
|
34
|
+
/** The ID of the user being warned. */
|
|
35
|
+
user_id: string
|
|
36
|
+
/** The login of the user being warned. */
|
|
37
|
+
user_login: string
|
|
38
|
+
/** The user name of the user being. */
|
|
39
|
+
user_name: string
|
|
40
|
+
/** The reason given for the warning. */
|
|
41
|
+
reason?: string
|
|
42
|
+
/** The chat rules cited for the warning. */
|
|
43
|
+
chat_rules_cited?: string[]
|
|
44
|
+
}
|
|
45
|
+
}>
|
|
46
|
+
|
|
47
|
+
registerEvent("channel.warning.send", {
|
|
48
|
+
scopes: ["moderator:manage:warnings", "moderator:read:warnings"],
|
|
49
|
+
subscriber: (userId) => ({
|
|
50
|
+
type: "channel.warning.send",
|
|
51
|
+
version: "1",
|
|
52
|
+
condition: {
|
|
53
|
+
broadcaster_user_id: userId,
|
|
54
|
+
moderator_user_id: userId,
|
|
55
|
+
},
|
|
56
|
+
}),
|
|
57
|
+
})
|
|
@@ -1,284 +1,73 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
export * from "./channel.guest_star_guest.update.js"
|
|
75
|
-
export * from "./channel.guest_star_session.begin.js"
|
|
76
|
-
export * from "./channel.guest_star_session.end.js"
|
|
77
|
-
export * from "./channel.guest_star_settings.update.js"
|
|
78
|
-
export * from "./channel.hype_train.begin.js"
|
|
79
|
-
export * from "./channel.hype_train.end.js"
|
|
80
|
-
export * from "./channel.hype_train.progress.js"
|
|
81
|
-
export * from "./channel.moderator.add.js"
|
|
82
|
-
export * from "./channel.moderator.remove.js"
|
|
83
|
-
export * from "./channel.poll.begin.js"
|
|
84
|
-
export * from "./channel.poll.end.js"
|
|
85
|
-
export * from "./channel.poll.progress.js"
|
|
86
|
-
export * from "./channel.prediction.begin.js"
|
|
87
|
-
export * from "./channel.prediction.end.js"
|
|
88
|
-
export * from "./channel.prediction.lock.js"
|
|
89
|
-
export * from "./channel.prediction.progress.js"
|
|
90
|
-
export * from "./channel.raid.js"
|
|
91
|
-
export * from "./channel.shield_mode.begin.js"
|
|
92
|
-
export * from "./channel.shield_mode.end.js"
|
|
93
|
-
export * from "./channel.shoutout.create.js"
|
|
94
|
-
export * from "./channel.shoutout.receive.js"
|
|
95
|
-
export * from "./channel.subscribe.js"
|
|
96
|
-
export * from "./channel.subscription.end.js"
|
|
97
|
-
export * from "./channel.subscription.gift.js"
|
|
98
|
-
export * from "./channel.subscription.message.js"
|
|
99
|
-
export * from "./channel.unban.js"
|
|
100
|
-
export * from "./channel.update.js"
|
|
101
|
-
export * from "./stream.offline.js"
|
|
102
|
-
export * from "./stream.online.js"
|
|
103
|
-
export * from "./user.update.js"
|
|
104
|
-
|
|
105
|
-
type AllSubscription =
|
|
106
|
-
| ChannelAdBreakBeginSubscription
|
|
107
|
-
| ChannelBanSubscription
|
|
108
|
-
| ChannelChatClearSubscription
|
|
109
|
-
| ChannelChatClearUserMessagesSubscription
|
|
110
|
-
| ChannelChatMessageDeleteSubscription
|
|
111
|
-
| ChannelChatNotificationSubscription
|
|
112
|
-
| ChannelCheerSubscription
|
|
113
|
-
| ChannelFollowSubscription
|
|
114
|
-
| ChannelGuestStarGuestUpdateSubscription
|
|
115
|
-
| ChannelGuestStarSessionBeginSubscription
|
|
116
|
-
| ChannelGuestStarSessionEndSubscription
|
|
117
|
-
| ChannelGuestStarSettingsUpdateSubscription
|
|
118
|
-
| ChannelModeratorAddSubscription
|
|
119
|
-
| ChannelModeratorRemoveSubscription
|
|
120
|
-
| ChannelPointsCustomRewardAddSubscription
|
|
121
|
-
| ChannelPointsCustomRewardRedemptionAddSubscription
|
|
122
|
-
| ChannelPointsCustomRewardRedemptionUpdateSubscription
|
|
123
|
-
| ChannelPointsCustomRewardRemoveSubscription
|
|
124
|
-
| ChannelPointsCustomRewardUpdateSubscription
|
|
125
|
-
| ChannelPollBeginSubscription
|
|
126
|
-
| ChannelPollEndSubscription
|
|
127
|
-
| ChannelPollProgressSubscription
|
|
128
|
-
| ChannelPredictionBeginSubscription
|
|
129
|
-
| ChannelPredictionEndSubscription
|
|
130
|
-
| ChannelPredictionLockSubscription
|
|
131
|
-
| ChannelPredictionProgressSubscription
|
|
132
|
-
| ChannelRaidSubscription
|
|
133
|
-
| ChannelSubscribeSubscription
|
|
134
|
-
| ChannelSubscriptionEndSubscription
|
|
135
|
-
| ChannelSubscriptionGiftSubscription
|
|
136
|
-
| ChannelSubscriptionMessageSubscription
|
|
137
|
-
| ChannelUnbanSubscription
|
|
138
|
-
| ChannelUpdateSubscription
|
|
139
|
-
| CharityCampaignProgressSubscription
|
|
140
|
-
| CharityCampaignStartSubscription
|
|
141
|
-
| CharityCampaignStopSubscription
|
|
142
|
-
| CharityDonationSubscription
|
|
143
|
-
| GoalBeginSubscription
|
|
144
|
-
| GoalEndSubscription
|
|
145
|
-
| GoalProgressSubscription
|
|
146
|
-
| HypeTrainBeginSubscription
|
|
147
|
-
| HypeTrainEndSubscription
|
|
148
|
-
| HypeTrainProgressSubscription
|
|
149
|
-
| ShieldModeBeginSubscription
|
|
150
|
-
| ShieldModeEndSubscription
|
|
151
|
-
| ShoutoutCreateSubscription
|
|
152
|
-
| ShoutoutReceiveSubscription
|
|
153
|
-
| StreamOfflineSubscription
|
|
154
|
-
| StreamOnlineSubscription
|
|
155
|
-
| UserUpdateSubscription
|
|
156
|
-
|
|
157
|
-
type AllNotificationMessage =
|
|
158
|
-
| NotificationMessage<ChannelAdBreakBeginSubscription, ChannelAdBreakBeginEvent>
|
|
159
|
-
| NotificationMessage<ChannelBanSubscription, ChannelBanEvent>
|
|
160
|
-
| NotificationMessage<ChannelChatClearSubscription, ChannelChatClearEvent>
|
|
161
|
-
| NotificationMessage<ChannelChatClearUserMessagesSubscription, ChannelChatClearUserMessagesEvent>
|
|
162
|
-
| NotificationMessage<ChannelChatMessageDeleteSubscription, ChannelChatMessageDeleteEvent>
|
|
163
|
-
| NotificationMessage<ChannelChatNotificationSubscription, ChannelChatNotificationEvent>
|
|
164
|
-
| NotificationMessage<ChannelCheerSubscription, ChannelCheerEvent>
|
|
165
|
-
| NotificationMessage<ChannelFollowSubscription, ChannelFollowEvent>
|
|
166
|
-
| NotificationMessage<ChannelGuestStarGuestUpdateSubscription, ChannelGuestStarGuestUpdateEvent>
|
|
167
|
-
| NotificationMessage<ChannelGuestStarSessionBeginSubscription, ChannelGuestStarSessionBeginEvent>
|
|
168
|
-
| NotificationMessage<ChannelGuestStarSessionEndSubscription, ChannelGuestStarSessionEndEvent>
|
|
169
|
-
| NotificationMessage<ChannelGuestStarSettingsUpdateSubscription, ChannelGuestStarSettingsUpdateEvent>
|
|
170
|
-
| NotificationMessage<ChannelModeratorAddSubscription, ChannelModeratorAddEvent>
|
|
171
|
-
| NotificationMessage<ChannelModeratorRemoveSubscription, ChannelModeratorRemoveEvent>
|
|
172
|
-
| NotificationMessage<ChannelPointsCustomRewardAddSubscription, ChannelPointsCustomRewardAddEvent>
|
|
173
|
-
| NotificationMessage<ChannelPointsCustomRewardRedemptionAddSubscription, ChannelPointsCustomRewardRedemptionAddEvent>
|
|
174
|
-
| NotificationMessage<ChannelPointsCustomRewardRedemptionUpdateSubscription, ChannelPointsCustomRewardRedemptionUpdateEvent>
|
|
175
|
-
| NotificationMessage<ChannelPointsCustomRewardRemoveSubscription, ChannelPointsCustomRewardRemoveEvent>
|
|
176
|
-
| NotificationMessage<ChannelPointsCustomRewardUpdateSubscription, ChannelPointsCustomRewardUpdateEvent>
|
|
177
|
-
| NotificationMessage<ChannelPollBeginSubscription, ChannelPollBeginEvent>
|
|
178
|
-
| NotificationMessage<ChannelPollEndSubscription, ChannelPollEndEvent>
|
|
179
|
-
| NotificationMessage<ChannelPollProgressSubscription, ChannelPollProgressEvent>
|
|
180
|
-
| NotificationMessage<ChannelPredictionBeginSubscription, ChannelPredictionBeginEvent>
|
|
181
|
-
| NotificationMessage<ChannelPredictionEndSubscription, ChannelPredictionEndEvent>
|
|
182
|
-
| NotificationMessage<ChannelPredictionLockSubscription, ChannelPredictionLockEvent>
|
|
183
|
-
| NotificationMessage<ChannelPredictionProgressSubscription, ChannelPredictionProgressEvent>
|
|
184
|
-
| NotificationMessage<ChannelRaidSubscription, ChannelRaidEvent>
|
|
185
|
-
| NotificationMessage<ChannelSubscribeSubscription, ChannelSubscribeEvent>
|
|
186
|
-
| NotificationMessage<ChannelSubscriptionEndSubscription, ChannelSubscriptionEndEvent>
|
|
187
|
-
| NotificationMessage<ChannelSubscriptionGiftSubscription, ChannelSubscriptionGiftEvent>
|
|
188
|
-
| NotificationMessage<ChannelSubscriptionMessageSubscription, ChannelSubscriptionMessageEvent>
|
|
189
|
-
| NotificationMessage<ChannelUnbanSubscription, ChannelUnbanEvent>
|
|
190
|
-
| NotificationMessage<ChannelUpdateSubscription, ChannelUpdateEvent>
|
|
191
|
-
| NotificationMessage<CharityCampaignProgressSubscription, CharityCampaignProgressEvent>
|
|
192
|
-
| NotificationMessage<CharityCampaignStartSubscription, CharityCampaignStartEvent>
|
|
193
|
-
| NotificationMessage<CharityCampaignStopSubscription, CharityCampaignStopEvent>
|
|
194
|
-
| NotificationMessage<CharityDonationSubscription, CharityDonationEvent>
|
|
195
|
-
| NotificationMessage<GoalBeginSubscription, GoalBeginEvent>
|
|
196
|
-
| NotificationMessage<GoalEndSubscription, GoalEndEvent>
|
|
197
|
-
| NotificationMessage<GoalProgressSubscription, GoalProgressEvent>
|
|
198
|
-
| NotificationMessage<HypeTrainBeginSubscription, HypeTrainBeginEvent>
|
|
199
|
-
| NotificationMessage<HypeTrainEndSubscription, HypeTrainEndEvent>
|
|
200
|
-
| NotificationMessage<HypeTrainProgressSubscription, HypeTrainProgressEvent>
|
|
201
|
-
| NotificationMessage<ShieldModeBeginSubscription, ShieldModeBeginEvent>
|
|
202
|
-
| NotificationMessage<ShieldModeEndSubscription, ShieldModeEndEvent>
|
|
203
|
-
| NotificationMessage<ShoutoutCreateSubscription, ShoutoutCreateEvent>
|
|
204
|
-
| NotificationMessage<ShoutoutReceiveSubscription, ShoutoutReceiveEvent>
|
|
205
|
-
| NotificationMessage<StreamOfflineSubscription, StreamOfflineEvent>
|
|
206
|
-
| NotificationMessage<StreamOnlineSubscription, StreamOnlineEvent>
|
|
207
|
-
| NotificationMessage<UserUpdateSubscription, UserUpdateEvent>
|
|
208
|
-
|
|
209
|
-
export type TwitchSubscriptionType = AllSubscription["type"]
|
|
210
|
-
|
|
211
|
-
export type TwitchSubscription<
|
|
212
|
-
Type extends TwitchSubscriptionType = TwitchSubscriptionType,
|
|
213
|
-
> = Extract<AllSubscription, { type: Type }>
|
|
214
|
-
|
|
215
|
-
export type TwitchNotificationMessage<
|
|
216
|
-
Type extends TwitchSubscriptionType = TwitchSubscriptionType,
|
|
217
|
-
> = Extract<AllNotificationMessage, { payload: { type: Type } }>
|
|
218
|
-
|
|
219
|
-
const subscriptionBuilders: {
|
|
220
|
-
[Type in TwitchSubscriptionType]: (userId: string) => TwitchSubscription<Type>
|
|
221
|
-
} = {
|
|
222
|
-
"channel.ad_break.begin": makeChannelAdBreakBeginSubscription,
|
|
223
|
-
"channel.ban": makeChannelBanSubscription,
|
|
224
|
-
"channel.channel_points_custom_reward.add": makeChannelPointsCustomRewardAddSubscription,
|
|
225
|
-
"channel.channel_points_custom_reward.remove": makeChannelPointsCustomRewardRemoveSubscription,
|
|
226
|
-
"channel.channel_points_custom_reward.update": makeChannelPointsCustomRewardUpdateSubscription,
|
|
227
|
-
"channel.channel_points_custom_reward_redemption.add": makeChannelPointsCustomRewardRedemptionAddSubscription,
|
|
228
|
-
"channel.channel_points_custom_reward_redemption.update": makeChannelPointsCustomRewardRedemptionUpdateSubscription,
|
|
229
|
-
"channel.charity_campaign.donate": makeCharityDonationSubscription,
|
|
230
|
-
"channel.charity_campaign.progress": makeCharityCampaignProgressSubscription,
|
|
231
|
-
"channel.charity_campaign.start": makeCharityCampaignStartSubscription,
|
|
232
|
-
"channel.charity_campaign.stop": makeCharityCampaignStopSubscription,
|
|
233
|
-
"channel.chat.clear": makeChannelChatClearSubscription,
|
|
234
|
-
"channel.chat.clear_user_messages": makeChannelChatClearUserMessagesSubscription,
|
|
235
|
-
"channel.chat.message_delete": makeChannelChatMessageDeleteSubscription,
|
|
236
|
-
"channel.chat.notification": makeChannelChatNotificationSubscription,
|
|
237
|
-
"channel.cheer": makeChannelCheerSubscription,
|
|
238
|
-
"channel.follow": makeChannelFollowSubscription,
|
|
239
|
-
"channel.goal.begin": makeGoalBeginSubscription,
|
|
240
|
-
"channel.goal.end": makeGoalEndSubscription,
|
|
241
|
-
"channel.goal.progress": makeGoalProgressSubscription,
|
|
242
|
-
"channel.guest_star_guest.update": makeChannelGuestStarGuestUpdateSubscription,
|
|
243
|
-
"channel.guest_star_session.begin": makeChannelGuestStarSessionBeginSubscription,
|
|
244
|
-
"channel.guest_star_session.end": makeChannelGuestStarSessionEndSubscription,
|
|
245
|
-
"channel.guest_star_settings.update": makeChannelGuestStarSettingsUpdateSubscription,
|
|
246
|
-
"channel.hype_train.begin": makeHypeTrainBeginSubscription,
|
|
247
|
-
"channel.hype_train.end": makeHypeTrainEndSubscription,
|
|
248
|
-
"channel.hype_train.progress": makeHypeTrainProgressSubscription,
|
|
249
|
-
"channel.moderator.add": makeChannelModeratorAddSubscription,
|
|
250
|
-
"channel.moderator.remove": makeChannelModeratorRemoveSubscription,
|
|
251
|
-
"channel.poll.begin": makeChannelPollBeginSubscription,
|
|
252
|
-
"channel.poll.end": makeChannelPollEndSubscription,
|
|
253
|
-
"channel.poll.progress": makeChannelPollProgressSubscription,
|
|
254
|
-
"channel.prediction.begin": makeChannelPredictionBeginSubscription,
|
|
255
|
-
"channel.prediction.end": makeChannelPredictionEndSubscription,
|
|
256
|
-
"channel.prediction.lock": makeChannelPredictionLockSubscription,
|
|
257
|
-
"channel.prediction.progress": makeChannelPredictionProgressSubscription,
|
|
258
|
-
"channel.raid": makeChannelRaidSubscription,
|
|
259
|
-
"channel.shield_mode.begin": makeShieldModeBeginSubscription,
|
|
260
|
-
"channel.shield_mode.end": makeShieldModeEndSubscription,
|
|
261
|
-
"channel.shoutout.create": makeShoutoutCreateSubscription,
|
|
262
|
-
"channel.shoutout.receive": makeShoutoutReceiveSubscription,
|
|
263
|
-
"channel.subscribe": makeChannelSubscribeSubscription,
|
|
264
|
-
"channel.subscription.end": makeChannelSubscriptionEndSubscription,
|
|
265
|
-
"channel.subscription.gift": makeChannelSubscriptionGiftSubscription,
|
|
266
|
-
"channel.subscription.message": makeChannelSubscriptionMessageSubscription,
|
|
267
|
-
"channel.unban": makeChannelUnbanSubscription,
|
|
268
|
-
"channel.update": makeChannelUpdateSubscription,
|
|
269
|
-
"stream.offline": makeStreamOfflineSubscription,
|
|
270
|
-
"stream.online": makeStreamOnlineSubscription,
|
|
271
|
-
"user.update": makeUserUpdateSubscription,
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
export function buildSubscription<
|
|
275
|
-
Type extends TwitchSubscriptionType,
|
|
276
|
-
Subscription extends TwitchSubscription<Type>,
|
|
277
|
-
>(type: Type, userId: string): Subscription {
|
|
278
|
-
const creator = subscriptionBuilders[type]
|
|
279
|
-
if (!creator) {
|
|
280
|
-
throw new Error(`Unknown type ${type}`)
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
return creator(userId) as Subscription
|
|
284
|
-
}
|
|
1
|
+
import "./automod.message.hold-2.ts"
|
|
2
|
+
import "./automod.message.update-2.ts"
|
|
3
|
+
import "./automod.settings.update-1.ts"
|
|
4
|
+
import "./automod.terms.update-1.ts"
|
|
5
|
+
import "./channel.ad_break.begin-1.ts"
|
|
6
|
+
import "./channel.ban-1.ts"
|
|
7
|
+
import "./channel.bits.use-1.ts"
|
|
8
|
+
import "./channel.channel_points_automatic_reward_redemption.add-2.ts"
|
|
9
|
+
import "./channel.channel_points_custom_reward.add-1.ts"
|
|
10
|
+
import "./channel.channel_points_custom_reward.remove-1.ts"
|
|
11
|
+
import "./channel.channel_points_custom_reward.update-1.ts"
|
|
12
|
+
import "./channel.channel_points_custom_reward_redemption.add-1.ts"
|
|
13
|
+
import "./channel.channel_points_custom_reward_redemption.update-1.ts"
|
|
14
|
+
import "./channel.charity_campaign.donate-1.ts"
|
|
15
|
+
import "./channel.charity_campaign.progress-1.ts"
|
|
16
|
+
import "./channel.charity_campaign.start-1.ts"
|
|
17
|
+
import "./channel.charity_campaign.stop-1.ts"
|
|
18
|
+
import "./channel.chat.clear-1.ts"
|
|
19
|
+
import "./channel.chat.clear_user_messages-1.ts"
|
|
20
|
+
import "./channel.chat.message-1.ts"
|
|
21
|
+
import "./channel.chat.message_delete-1.ts"
|
|
22
|
+
import "./channel.chat.notification-1.ts"
|
|
23
|
+
import "./channel.chat.user_message_hold-1.ts"
|
|
24
|
+
import "./channel.chat.user_message_update-1.ts"
|
|
25
|
+
import "./channel.chat_settings.update-1.ts"
|
|
26
|
+
import "./channel.cheer-1.ts"
|
|
27
|
+
import "./channel.follow-2.ts"
|
|
28
|
+
import "./channel.goal.begin-1.ts"
|
|
29
|
+
import "./channel.goal.end-1.ts"
|
|
30
|
+
import "./channel.goal.progress-1.ts"
|
|
31
|
+
import "./channel.guest_star_guest.update-beta.ts"
|
|
32
|
+
import "./channel.guest_star_session.begin-beta.ts"
|
|
33
|
+
import "./channel.guest_star_session.end-beta.ts"
|
|
34
|
+
import "./channel.guest_star_settings.update-beta.ts"
|
|
35
|
+
import "./channel.hype_train.begin-2.ts"
|
|
36
|
+
import "./channel.hype_train.end-2.ts"
|
|
37
|
+
import "./channel.hype_train.progress-2.ts"
|
|
38
|
+
import "./channel.moderate-2.ts"
|
|
39
|
+
import "./channel.moderator.add-1.ts"
|
|
40
|
+
import "./channel.moderator.remove-1.ts"
|
|
41
|
+
import "./channel.poll.begin-1.ts"
|
|
42
|
+
import "./channel.poll.end-1.ts"
|
|
43
|
+
import "./channel.poll.progress-1.ts"
|
|
44
|
+
import "./channel.prediction.begin-1.ts"
|
|
45
|
+
import "./channel.prediction.end-1.ts"
|
|
46
|
+
import "./channel.prediction.lock-1.ts"
|
|
47
|
+
import "./channel.prediction.progress-1.ts"
|
|
48
|
+
import "./channel.raid-1.ts"
|
|
49
|
+
import "./channel.shared_chat.begin-1.ts"
|
|
50
|
+
import "./channel.shared_chat.end-1.ts"
|
|
51
|
+
import "./channel.shared_chat.update-1.ts"
|
|
52
|
+
import "./channel.shield_mode.begin-1.ts"
|
|
53
|
+
import "./channel.shield_mode.end-1.ts"
|
|
54
|
+
import "./channel.shoutout.create-1.ts"
|
|
55
|
+
import "./channel.shoutout.receive-1.ts"
|
|
56
|
+
import "./channel.subscribe-1.ts"
|
|
57
|
+
import "./channel.subscription.end-1.ts"
|
|
58
|
+
import "./channel.subscription.gift-1.ts"
|
|
59
|
+
import "./channel.subscription.message-1.ts"
|
|
60
|
+
import "./channel.suspicious_user.message-1.ts"
|
|
61
|
+
import "./channel.suspicious_user.update-1.ts"
|
|
62
|
+
import "./channel.unban-1.ts"
|
|
63
|
+
import "./channel.unban_request.create-1.ts"
|
|
64
|
+
import "./channel.unban_request.resolve-1.ts"
|
|
65
|
+
import "./channel.update-2.ts"
|
|
66
|
+
import "./channel.vip.add-1.ts"
|
|
67
|
+
import "./channel.vip.remove-1.ts"
|
|
68
|
+
import "./channel.warning.acknowledge-1.ts"
|
|
69
|
+
import "./channel.warning.send-1.ts"
|
|
70
|
+
import "./stream.offline-1.ts"
|
|
71
|
+
import "./stream.online-1.ts"
|
|
72
|
+
import "./user.update-1.ts"
|
|
73
|
+
import "./user.whisper.message-1.ts"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type EventConfig, registerEvent } from "../events-helpers.ts"
|
|
2
|
+
|
|
3
|
+
declare module "../events-helpers.ts" {
|
|
4
|
+
interface EventConfigs {
|
|
5
|
+
"stream.offline": StreamOffline
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Stream Offline v1: When the specified broadcaster stops a stream. */
|
|
10
|
+
type StreamOffline = EventConfig<{
|
|
11
|
+
Type: "stream.offline"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when the specified broadcaster stops a stream. */
|
|
14
|
+
Condition: {
|
|
15
|
+
/** The broadcaster user ID you want to get stream offline notifications for. */
|
|
16
|
+
broadcaster_user_id: string
|
|
17
|
+
}
|
|
18
|
+
/** The event fired when the specified broadcaster stops a stream. */
|
|
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
|
+
}
|
|
27
|
+
}>
|
|
28
|
+
|
|
29
|
+
registerEvent("stream.offline", {
|
|
30
|
+
scopes: [],
|
|
31
|
+
subscriber: (userId) => ({
|
|
32
|
+
type: "stream.offline",
|
|
33
|
+
version: "1",
|
|
34
|
+
condition: {
|
|
35
|
+
broadcaster_user_id: userId,
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
})
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type EventConfig, registerEvent } from "../events-helpers.ts"
|
|
2
|
+
|
|
3
|
+
declare module "../events-helpers.ts" {
|
|
4
|
+
interface EventConfigs {
|
|
5
|
+
"stream.online": StreamOnline
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Stream Online v1: When the specified broadcaster starts a stream. */
|
|
10
|
+
type StreamOnline = EventConfig<{
|
|
11
|
+
Type: "stream.online"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when the specified broadcaster starts a stream. */
|
|
14
|
+
Condition: {
|
|
15
|
+
/** The broadcaster user ID you want to get stream online notifications for. */
|
|
16
|
+
broadcaster_user_id: string
|
|
17
|
+
}
|
|
18
|
+
/** The event fired when the specified broadcaster starts a stream. */
|
|
19
|
+
Event: {
|
|
20
|
+
/** The id of the stream. */
|
|
21
|
+
id: string
|
|
22
|
+
/** The broadcaster's user id. */
|
|
23
|
+
broadcaster_user_id: string
|
|
24
|
+
/** The broadcaster's user login. */
|
|
25
|
+
broadcaster_user_login: string
|
|
26
|
+
/** The broadcaster's user display name. */
|
|
27
|
+
broadcaster_user_name: string
|
|
28
|
+
/** The stream type. Valid values are: live, playlist, watch_party, premiere, rerun. */
|
|
29
|
+
type: string
|
|
30
|
+
/** The timestamp at which the stream went online at. */
|
|
31
|
+
started_at: string
|
|
32
|
+
}
|
|
33
|
+
}>
|
|
34
|
+
|
|
35
|
+
registerEvent("stream.online", {
|
|
36
|
+
scopes: [],
|
|
37
|
+
subscriber: (userId) => ({
|
|
38
|
+
type: "stream.online",
|
|
39
|
+
version: "1",
|
|
40
|
+
condition: {
|
|
41
|
+
broadcaster_user_id: userId,
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
})
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type EventConfig, registerEvent } from "../events-helpers.ts"
|
|
2
|
+
|
|
3
|
+
declare module "../events-helpers.ts" {
|
|
4
|
+
interface EventConfigs {
|
|
5
|
+
"user.update": UserUpdate
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** User Update v1: When a user has updated their account. */
|
|
10
|
+
type UserUpdate = EventConfig<{
|
|
11
|
+
Type: "user.update"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when a user has updated their account. */
|
|
14
|
+
Condition: {
|
|
15
|
+
/** The user ID for the user you want update notifications for. */
|
|
16
|
+
user_id: string
|
|
17
|
+
}
|
|
18
|
+
/** The event fired when a user has updated their account. */
|
|
19
|
+
Event: {
|
|
20
|
+
/** The user's user id. */
|
|
21
|
+
user_id: string
|
|
22
|
+
/** The user's user login. */
|
|
23
|
+
user_login: string
|
|
24
|
+
/** The user's user display name. */
|
|
25
|
+
user_name: string
|
|
26
|
+
/** The user's email address. The event includes the user's email address only if the app used to request this event type includes the user:read:email scope for the user; otherwise, the field is set to an empty string. See "Create EventSub Subscription". */
|
|
27
|
+
email: string
|
|
28
|
+
/**
|
|
29
|
+
* A Boolean value that determines whether Twitch has verified the user's email address. Is true if Twitch has verified the email address; otherwise, false.
|
|
30
|
+
*
|
|
31
|
+
* NOTE: Ignore this field if the email field contains an empty string.
|
|
32
|
+
*/
|
|
33
|
+
email_verified: boolean
|
|
34
|
+
/** The user's description. */
|
|
35
|
+
description: string
|
|
36
|
+
}
|
|
37
|
+
}>
|
|
38
|
+
|
|
39
|
+
registerEvent("user.update", {
|
|
40
|
+
scopes: ["user:read:email"],
|
|
41
|
+
subscriber: (userId) => ({
|
|
42
|
+
type: "user.update",
|
|
43
|
+
version: "1",
|
|
44
|
+
condition: {
|
|
45
|
+
user_id: userId,
|
|
46
|
+
},
|
|
47
|
+
}),
|
|
48
|
+
})
|