@overlaysymphony/twitch 0.2.2 → 0.3.0
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 +6 -2
- package/src/authentication/authentication.ts +1 -1
- package/src/authentication/index.ts +1 -1
- package/src/chat/chat.ts +69 -134
- package/src/chat/helpers.ts +33 -24
- package/src/chat/index.ts +4 -6
- package/src/chat/pronouns.ts +141 -0
- 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 +52 -24
- 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 +120 -33
- package/src/helix/channel-points/index.ts +1 -1
- package/src/helix/channels/channels.ts +39 -0
- package/src/helix/channels/index.ts +1 -0
- package/src/helix/chat/emotes.ts +49 -0
- package/src/helix/chat/index.ts +3 -0
- package/src/helix/chat/send.ts +109 -0
- package/src/helix/chat/shared.ts +49 -0
- package/src/helix/helix.ts +6 -21
- package/src/helix/subscriptions/index.ts +1 -1
- package/src/helix/subscriptions/subscriptions.ts +46 -48
- package/src/helix/users/index.ts +1 -1
- package/src/helix/users/users.ts +22 -19
- 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 +2 -2
- 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/chat/interfaces/events.ts +0 -269
- package/src/chat/interfaces/index.ts +0 -9
- package/src/chat/parser.ts +0 -254
- 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,46 @@
|
|
|
1
|
+
import { type EventConfig, registerEvent } from "../events-helpers.ts"
|
|
2
|
+
|
|
3
|
+
declare module "../events-helpers.ts" {
|
|
4
|
+
interface EventConfigs {
|
|
5
|
+
"channel.shared_chat.end": ChannelSharedChatEnd
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Channel Shared Chat End v1: When a channel leaves a shared chat session or the session ends. */
|
|
10
|
+
type ChannelSharedChatEnd = EventConfig<{
|
|
11
|
+
Type: "channel.shared_chat.end"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when a channel leaves a shared chat session or the session ends. */
|
|
14
|
+
Condition: {
|
|
15
|
+
/** The User ID of the channel to receive shared chat session end events for. */
|
|
16
|
+
broadcaster_user_id: string
|
|
17
|
+
}
|
|
18
|
+
/** The event fired when a channel leaves a shared chat session or the session ends. */
|
|
19
|
+
Event: {
|
|
20
|
+
/** The unique identifier for the shared chat session. */
|
|
21
|
+
session_id: string
|
|
22
|
+
/** The User ID of the channel in the subscription condition which is no longer active in the shared chat session. */
|
|
23
|
+
broadcaster_user_id: string
|
|
24
|
+
/** The display name of the channel in the subscription condition which is no longer active in the shared chat session. */
|
|
25
|
+
broadcaster_user_name: string
|
|
26
|
+
/** The user login of the channel in the subscription condition which is no longer active in the shared chat session. */
|
|
27
|
+
broadcaster_user_login: string
|
|
28
|
+
/** The User ID of the host channel. */
|
|
29
|
+
host_broadcaster_user_id: string
|
|
30
|
+
/** The display name of the host channel. */
|
|
31
|
+
host_broadcaster_user_name: string
|
|
32
|
+
/** The user login of the host channel. */
|
|
33
|
+
host_broadcaster_user_login: string
|
|
34
|
+
}
|
|
35
|
+
}>
|
|
36
|
+
|
|
37
|
+
registerEvent("channel.shared_chat.end", {
|
|
38
|
+
scopes: [],
|
|
39
|
+
subscriber: (userId) => ({
|
|
40
|
+
type: "channel.shared_chat.end",
|
|
41
|
+
version: "1",
|
|
42
|
+
condition: {
|
|
43
|
+
broadcaster_user_id: userId,
|
|
44
|
+
},
|
|
45
|
+
}),
|
|
46
|
+
})
|
|
@@ -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.shared_chat.update": ChannelSharedChatUpdate
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Channel Shared Chat Update v1: When the active shared chat session the channel is in changes. */
|
|
10
|
+
type ChannelSharedChatUpdate = EventConfig<{
|
|
11
|
+
Type: "channel.shared_chat.update"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when the active shared chat session the channel is in changes. */
|
|
14
|
+
Condition: {
|
|
15
|
+
/** The User ID of the channel to receive shared chat session update events for. */
|
|
16
|
+
broadcaster_user_id: string
|
|
17
|
+
}
|
|
18
|
+
/** The event fired when the active shared chat session the channel is in changes. */
|
|
19
|
+
Event: {
|
|
20
|
+
/** The unique identifier for the shared chat session. */
|
|
21
|
+
session_id: string
|
|
22
|
+
/** The User ID of the channel in the subscription condition. */
|
|
23
|
+
broadcaster_user_id: string
|
|
24
|
+
/** The display name of the channel in the subscription condition. */
|
|
25
|
+
broadcaster_user_name: string
|
|
26
|
+
/** The user login of the channel in the subscription condition. */
|
|
27
|
+
broadcaster_user_login: string
|
|
28
|
+
/** The User ID of the host channel. */
|
|
29
|
+
host_broadcaster_user_id: string
|
|
30
|
+
/** The display name of the host channel. */
|
|
31
|
+
host_broadcaster_user_name: string
|
|
32
|
+
/** The user login of the host channel. */
|
|
33
|
+
host_broadcaster_user_login: string
|
|
34
|
+
/** The list of participants in the session. */
|
|
35
|
+
participants: {
|
|
36
|
+
/** The User ID of the participant channel. */
|
|
37
|
+
broadcaster_user_id: string
|
|
38
|
+
/** The display name of the participant channel. */
|
|
39
|
+
broadcaster_user_name: string
|
|
40
|
+
/** The user login of the participant channel. */
|
|
41
|
+
broadcaster_user_login: string
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}>
|
|
45
|
+
|
|
46
|
+
registerEvent("channel.shared_chat.update", {
|
|
47
|
+
scopes: [],
|
|
48
|
+
subscriber: (userId) => ({
|
|
49
|
+
type: "channel.shared_chat.update",
|
|
50
|
+
version: "1",
|
|
51
|
+
condition: {
|
|
52
|
+
broadcaster_user_id: userId,
|
|
53
|
+
},
|
|
54
|
+
}),
|
|
55
|
+
})
|
|
@@ -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.shield_mode.begin": ChannelShieldModeBegin
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Channel Shield Mode Begin v1: When the broadcaster activates Shield Mode. */
|
|
10
|
+
type ChannelShieldModeBegin = EventConfig<{
|
|
11
|
+
Type: "channel.shield_mode.begin"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when the broadcaster activates Shield Mode. */
|
|
14
|
+
Condition: {
|
|
15
|
+
/** The ID of the broadcaster that you want to receive notifications about when they activate Shield Mode. */
|
|
16
|
+
broadcaster_user_id: string
|
|
17
|
+
/** The ID of the broadcaster or one of the broadcaster's moderators. */
|
|
18
|
+
moderator_user_id: string
|
|
19
|
+
}
|
|
20
|
+
/** The event fired when the broadcaster activates Shield Mode. */
|
|
21
|
+
Event: {
|
|
22
|
+
/** An ID that identifies the broadcaster whose Shield Mode status was updated. */
|
|
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 moderator that updated the Shield Mode's status. If the broadcaster updated the status, this ID will be the same as broadcaster_user_id. */
|
|
29
|
+
moderator_user_id: string
|
|
30
|
+
/** The moderator's login name. */
|
|
31
|
+
moderator_user_login: string
|
|
32
|
+
/** The moderator's display name. */
|
|
33
|
+
moderator_user_name: string
|
|
34
|
+
/** The UTC timestamp (in RFC3339 format) of when the moderator activated Shield Mode. The object includes this field only for channel.shield_mode.begin events. */
|
|
35
|
+
started_at: string
|
|
36
|
+
/** The UTC timestamp (in RFC3339 format) of when the moderator deactivated Shield Mode. The object includes this field only for channel.shield_mode.end events. */
|
|
37
|
+
ended_at: string
|
|
38
|
+
}
|
|
39
|
+
}>
|
|
40
|
+
|
|
41
|
+
registerEvent("channel.shield_mode.begin", {
|
|
42
|
+
scopes: ["moderator:manage:shield", "moderator:read:shield"],
|
|
43
|
+
subscriber: (userId) => ({
|
|
44
|
+
type: "channel.shield_mode.begin",
|
|
45
|
+
version: "1",
|
|
46
|
+
condition: {
|
|
47
|
+
broadcaster_user_id: userId,
|
|
48
|
+
moderator_user_id: userId,
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
})
|
|
@@ -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.shield_mode.end": ChannelShieldModeEnd
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Channel Shield Mode End v1: When the broadcaster deactivates Shield Mode. */
|
|
10
|
+
type ChannelShieldModeEnd = EventConfig<{
|
|
11
|
+
Type: "channel.shield_mode.end"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when the broadcaster deactivates Shield Mode. */
|
|
14
|
+
Condition: {
|
|
15
|
+
/** The ID of the broadcaster that you want to receive notifications about when they deactivate Shield Mode. */
|
|
16
|
+
broadcaster_user_id: string
|
|
17
|
+
/** The ID of the broadcaster or one of the broadcaster's moderators. */
|
|
18
|
+
moderator_user_id: string
|
|
19
|
+
}
|
|
20
|
+
/** The event fired when the broadcaster deactivates Shield Mode. */
|
|
21
|
+
Event: {
|
|
22
|
+
/** An ID that identifies the broadcaster whose Shield Mode status was updated. */
|
|
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 moderator that updated the Shield Mode's status. If the broadcaster updated the status, this ID will be the same as broadcaster_user_id. */
|
|
29
|
+
moderator_user_id: string
|
|
30
|
+
/** The moderator's login name. */
|
|
31
|
+
moderator_user_login: string
|
|
32
|
+
/** The moderator's display name. */
|
|
33
|
+
moderator_user_name: string
|
|
34
|
+
/** The UTC timestamp (in RFC3339 format) of when the moderator activated Shield Mode. The object includes this field only for channel.shield_mode.begin events. */
|
|
35
|
+
started_at: string
|
|
36
|
+
/** The UTC timestamp (in RFC3339 format) of when the moderator deactivated Shield Mode. The object includes this field only for channel.shield_mode.end events. */
|
|
37
|
+
ended_at: string
|
|
38
|
+
}
|
|
39
|
+
}>
|
|
40
|
+
|
|
41
|
+
registerEvent("channel.shield_mode.end", {
|
|
42
|
+
scopes: ["moderator:manage:shield", "moderator:read:shield"],
|
|
43
|
+
subscriber: (userId) => ({
|
|
44
|
+
type: "channel.shield_mode.end",
|
|
45
|
+
version: "1",
|
|
46
|
+
condition: {
|
|
47
|
+
broadcaster_user_id: userId,
|
|
48
|
+
moderator_user_id: userId,
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
})
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type EventConfig, registerEvent } from "../events-helpers.ts"
|
|
2
|
+
|
|
3
|
+
declare module "../events-helpers.ts" {
|
|
4
|
+
interface EventConfigs {
|
|
5
|
+
"channel.shoutout.create": ChannelShoutoutCreate
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Channel Shoutout Create v1: When the specified broadcaster sends a Shoutout. */
|
|
10
|
+
type ChannelShoutoutCreate = EventConfig<{
|
|
11
|
+
Type: "channel.shoutout.create"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when the specified broadcaster sends a Shoutout. */
|
|
14
|
+
Condition: {
|
|
15
|
+
/** The ID of the broadcaster that you want to receive notifications about when they send a Shoutout. */
|
|
16
|
+
broadcaster_user_id: string
|
|
17
|
+
/** The ID of the broadcaster that gave the Shoutout or one of the broadcaster's moderators. */
|
|
18
|
+
moderator_user_id: string
|
|
19
|
+
}
|
|
20
|
+
/** The event fired when the specified broadcaster sends a Shoutout. */
|
|
21
|
+
Event: {
|
|
22
|
+
/** An ID that identifies the broadcaster that sent 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 received the Shoutout. */
|
|
29
|
+
to_broadcaster_user_id: string
|
|
30
|
+
/** The broadcaster's login name. */
|
|
31
|
+
to_broadcaster_user_login: string
|
|
32
|
+
/** The broadcaster's display name. */
|
|
33
|
+
to_broadcaster_user_name: string
|
|
34
|
+
/** An ID that identifies the moderator that sent the Shoutout. If the broadcaster sent the Shoutout, this ID is the same as the ID in broadcaster_user_id. */
|
|
35
|
+
moderator_user_id: string
|
|
36
|
+
/** The moderator's login name. */
|
|
37
|
+
moderator_user_login: string
|
|
38
|
+
/** The moderator's display name. */
|
|
39
|
+
moderator_user_name: string
|
|
40
|
+
/** The number of users that were watching the broadcaster's stream at the time of the Shoutout. */
|
|
41
|
+
viewer_count: number
|
|
42
|
+
/** The UTC timestamp (in RFC3339 format) of when the moderator sent the Shoutout. */
|
|
43
|
+
started_at: string
|
|
44
|
+
/** The UTC timestamp (in RFC3339 format) of when the broadcaster may send a Shoutout to a different broadcaster. */
|
|
45
|
+
cooldown_ends_at: string
|
|
46
|
+
/** The UTC timestamp (in RFC3339 format) of when the broadcaster may send another Shoutout to the broadcaster in to_broadcaster_user_id. */
|
|
47
|
+
target_cooldown_ends_at: string
|
|
48
|
+
}
|
|
49
|
+
}>
|
|
50
|
+
|
|
51
|
+
registerEvent("channel.shoutout.create", {
|
|
52
|
+
scopes: ["moderator:manage:shoutouts", "moderator:read:shoutouts"],
|
|
53
|
+
subscriber: (userId) => ({
|
|
54
|
+
type: "channel.shoutout.create",
|
|
55
|
+
version: "1",
|
|
56
|
+
condition: {
|
|
57
|
+
broadcaster_user_id: userId,
|
|
58
|
+
moderator_user_id: userId,
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
})
|
|
@@ -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
|
+
})
|