@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,76 @@
|
|
|
1
|
+
import { type EventConfig, registerEvent } from "../events-helpers.ts"
|
|
2
|
+
|
|
3
|
+
declare module "../events-helpers.ts" {
|
|
4
|
+
interface EventConfigs {
|
|
5
|
+
"channel.charity_campaign.start": ChannelCharityCampaignStart
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Channel Charity Campaign Start v1: When the broadcaster starts a charity campaign. */
|
|
10
|
+
type ChannelCharityCampaignStart = EventConfig<{
|
|
11
|
+
Type: "channel.charity_campaign.start"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when the broadcaster starts a charity campaign. */
|
|
14
|
+
Condition: {
|
|
15
|
+
/** The ID of the broadcaster that you want to receive notifications about when they start a charity campaign. */
|
|
16
|
+
broadcaster_user_id: string
|
|
17
|
+
}
|
|
18
|
+
/** The event fired when the broadcaster starts a charity campaign. */
|
|
19
|
+
Event: {
|
|
20
|
+
/** An ID that identifies the charity campaign. */
|
|
21
|
+
id: string
|
|
22
|
+
/** An ID that identifies the broadcaster that's running the campaign. */
|
|
23
|
+
broadcaster_id: string
|
|
24
|
+
/** The broadcaster's login name. */
|
|
25
|
+
broadcaster_login: string
|
|
26
|
+
/** The broadcaster's display name. */
|
|
27
|
+
broadcaster_name: string
|
|
28
|
+
/** The charity's name. */
|
|
29
|
+
charity_name: string
|
|
30
|
+
/** A description of the charity. */
|
|
31
|
+
charity_description: string
|
|
32
|
+
/** A URL to an image of the charity's logo. The image's type is PNG and its size is 100px X 100px. */
|
|
33
|
+
charity_logo: string
|
|
34
|
+
/** A URL to the charity's website. */
|
|
35
|
+
charity_website: string
|
|
36
|
+
/** An object that contains the current amount of donations that the campaign has received. */
|
|
37
|
+
current_amount: {
|
|
38
|
+
/** The monetary amount. The amount is specified in the currency's minor unit. */
|
|
39
|
+
value: number
|
|
40
|
+
/**
|
|
41
|
+
* The number of decimal places used by the currency.
|
|
42
|
+
*
|
|
43
|
+
* value / 10^decimal_places
|
|
44
|
+
*/
|
|
45
|
+
decimal_places: number
|
|
46
|
+
/** The ISO-4217 three-letter currency code that identifies the type of currency in value. */
|
|
47
|
+
currency: string
|
|
48
|
+
}
|
|
49
|
+
/** An object that contains the campaign's target fundraising goal. */
|
|
50
|
+
target_amount: {
|
|
51
|
+
/** The monetary amount. The amount is specified in the currency's minor unit. */
|
|
52
|
+
value: number
|
|
53
|
+
/**
|
|
54
|
+
* The number of decimal places used by the currency.
|
|
55
|
+
*
|
|
56
|
+
* value / 10^decimal_places
|
|
57
|
+
*/
|
|
58
|
+
decimal_places: number
|
|
59
|
+
/** The ISO-4217 three-letter currency code that identifies the type of currency in value. */
|
|
60
|
+
currency: string
|
|
61
|
+
}
|
|
62
|
+
/** The UTC timestamp (in RFC3339 format) of when the broadcaster started the campaign. */
|
|
63
|
+
started_at: string
|
|
64
|
+
}
|
|
65
|
+
}>
|
|
66
|
+
|
|
67
|
+
registerEvent("channel.charity_campaign.start", {
|
|
68
|
+
scopes: ["channel:read:charity"],
|
|
69
|
+
subscriber: (userId) => ({
|
|
70
|
+
type: "channel.charity_campaign.start",
|
|
71
|
+
version: "1",
|
|
72
|
+
condition: {
|
|
73
|
+
broadcaster_user_id: userId,
|
|
74
|
+
},
|
|
75
|
+
}),
|
|
76
|
+
})
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type EventConfig, registerEvent } from "../events-helpers.ts"
|
|
2
|
+
|
|
3
|
+
declare module "../events-helpers.ts" {
|
|
4
|
+
interface EventConfigs {
|
|
5
|
+
"channel.charity_campaign.stop": ChannelCharityCampaignStop
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Channel Charity Campaign Stop v1: When the broadcaster stops a charity campaign. */
|
|
10
|
+
type ChannelCharityCampaignStop = EventConfig<{
|
|
11
|
+
Type: "channel.charity_campaign.stop"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when the broadcaster stops a charity campaign. */
|
|
14
|
+
Condition: {
|
|
15
|
+
/** The ID of the broadcaster that you want to receive notifications about when they stop a charity campaign. */
|
|
16
|
+
broadcaster_user_id: string
|
|
17
|
+
}
|
|
18
|
+
/** The event fired when the broadcaster stops a charity campaign. */
|
|
19
|
+
Event: {
|
|
20
|
+
/** An ID that identifies the charity campaign. */
|
|
21
|
+
id: string
|
|
22
|
+
/** An ID that identifies the broadcaster that ran the campaign. */
|
|
23
|
+
broadcaster_id: string
|
|
24
|
+
/** The broadcaster's login name. */
|
|
25
|
+
broadcaster_login: string
|
|
26
|
+
/** The broadcaster's display name. */
|
|
27
|
+
broadcaster_name: string
|
|
28
|
+
/** The charity's name. */
|
|
29
|
+
charity_name: string
|
|
30
|
+
/** A description of the charity. */
|
|
31
|
+
charity_description: string
|
|
32
|
+
/** A URL to an image of the charity's logo. The image's type is PNG and its size is 100px X 100px. */
|
|
33
|
+
charity_logo: string
|
|
34
|
+
/** A URL to the charity's website. */
|
|
35
|
+
charity_website: string
|
|
36
|
+
/** An object that contains the final amount of donations that the campaign received. */
|
|
37
|
+
current_amount: {
|
|
38
|
+
/** The monetary amount. The amount is specified in the currency's minor unit. */
|
|
39
|
+
value: number
|
|
40
|
+
/**
|
|
41
|
+
* The number of decimal places used by the currency.
|
|
42
|
+
*
|
|
43
|
+
* value / 10^decimal_places
|
|
44
|
+
*/
|
|
45
|
+
decimal_places: number
|
|
46
|
+
/** The ISO-4217 three-letter currency code that identifies the type of currency in value. */
|
|
47
|
+
currency: string
|
|
48
|
+
}
|
|
49
|
+
/** An object that contains the campaign's target fundraising goal. */
|
|
50
|
+
target_amount: {
|
|
51
|
+
/** The monetary amount. The amount is specified in the currency's minor unit. */
|
|
52
|
+
value: number
|
|
53
|
+
/**
|
|
54
|
+
* The number of decimal places used by the currency.
|
|
55
|
+
*
|
|
56
|
+
* value / 10^decimal_places
|
|
57
|
+
*/
|
|
58
|
+
decimal_places: number
|
|
59
|
+
/** The ISO-4217 three-letter currency code that identifies the type of currency in value. */
|
|
60
|
+
currency: string
|
|
61
|
+
}
|
|
62
|
+
/** The UTC timestamp (in RFC3339 format) of when the broadcaster stopped the campaign. */
|
|
63
|
+
stopped_at: string
|
|
64
|
+
}
|
|
65
|
+
}>
|
|
66
|
+
|
|
67
|
+
registerEvent("channel.charity_campaign.stop", {
|
|
68
|
+
scopes: ["channel:read:charity"],
|
|
69
|
+
subscriber: (userId) => ({
|
|
70
|
+
type: "channel.charity_campaign.stop",
|
|
71
|
+
version: "1",
|
|
72
|
+
condition: {
|
|
73
|
+
broadcaster_user_id: userId,
|
|
74
|
+
},
|
|
75
|
+
}),
|
|
76
|
+
})
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type EventConfig, registerEvent } from "../events-helpers.ts"
|
|
2
|
+
|
|
3
|
+
declare module "../events-helpers.ts" {
|
|
4
|
+
interface EventConfigs {
|
|
5
|
+
"channel.chat.clear": ChannelChatClear
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Channel Chat Clear v1: When a moderator or bot has cleared all messages from the chat room. */
|
|
10
|
+
type ChannelChatClear = EventConfig<{
|
|
11
|
+
Type: "channel.chat.clear"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when a moderator or bot has cleared all messages from the chat room. */
|
|
14
|
+
Condition: {
|
|
15
|
+
/** User ID of the channel to receive chat clear events for. */
|
|
16
|
+
broadcaster_user_id: string
|
|
17
|
+
/** The user ID to read chat as. */
|
|
18
|
+
user_id: string
|
|
19
|
+
}
|
|
20
|
+
/** The event fired when a moderator or bot has cleared all messages from the chat room. */
|
|
21
|
+
Event: {
|
|
22
|
+
/** The broadcaster user ID. */
|
|
23
|
+
broadcaster_user_id: string
|
|
24
|
+
/** The broadcaster display name. */
|
|
25
|
+
broadcaster_user_name: string
|
|
26
|
+
/** The broadcaster login. */
|
|
27
|
+
broadcaster_user_login: string
|
|
28
|
+
}
|
|
29
|
+
}>
|
|
30
|
+
|
|
31
|
+
registerEvent("channel.chat.clear", {
|
|
32
|
+
scopes: ["user:read:chat"],
|
|
33
|
+
subscriber: (userId) => ({
|
|
34
|
+
type: "channel.chat.clear",
|
|
35
|
+
version: "1",
|
|
36
|
+
condition: {
|
|
37
|
+
broadcaster_user_id: userId,
|
|
38
|
+
user_id: userId,
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
})
|
|
@@ -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.chat.clear_user_messages": ChannelChatClearUserMessages
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Channel Chat Clear User Messages v1: When a moderator or bot has cleared all messages from a specific user. */
|
|
10
|
+
type ChannelChatClearUserMessages = EventConfig<{
|
|
11
|
+
Type: "channel.chat.clear_user_messages"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when a moderator or bot has cleared all messages from a specific user. */
|
|
14
|
+
Condition: {
|
|
15
|
+
/** User ID of the channel to receive chat clear user messages events for. */
|
|
16
|
+
broadcaster_user_id: string
|
|
17
|
+
/** The user ID to read chat as. */
|
|
18
|
+
user_id: string
|
|
19
|
+
}
|
|
20
|
+
/** The event fired when a moderator or bot has cleared all messages from a specific user. */
|
|
21
|
+
Event: {
|
|
22
|
+
/** The broadcaster user ID. */
|
|
23
|
+
broadcaster_user_id: string
|
|
24
|
+
/** The broadcaster display name. */
|
|
25
|
+
broadcaster_user_name: string
|
|
26
|
+
/** The broadcaster login. */
|
|
27
|
+
broadcaster_user_login: string
|
|
28
|
+
/** The ID of the user that was banned or put in a timeout. All of their messages are deleted. */
|
|
29
|
+
target_user_id: string
|
|
30
|
+
/** The user name of the user that was banned or put in a timeout. */
|
|
31
|
+
target_user_name: string
|
|
32
|
+
/** The user login of the user that was banned or put in a timeout. */
|
|
33
|
+
target_user_login: string
|
|
34
|
+
}
|
|
35
|
+
}>
|
|
36
|
+
|
|
37
|
+
registerEvent("channel.chat.clear_user_messages", {
|
|
38
|
+
scopes: ["user:read:chat"],
|
|
39
|
+
subscriber: (userId) => ({
|
|
40
|
+
type: "channel.chat.clear_user_messages",
|
|
41
|
+
version: "1",
|
|
42
|
+
condition: {
|
|
43
|
+
broadcaster_user_id: userId,
|
|
44
|
+
user_id: userId,
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
})
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { type EventConfig, registerEvent } from "../events-helpers.ts"
|
|
2
|
+
|
|
3
|
+
declare module "../events-helpers.ts" {
|
|
4
|
+
interface EventConfigs {
|
|
5
|
+
"channel.chat.message": ChannelChatMessage
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Channel Chat Message v1: When a user sends a message to a specific chat room. */
|
|
10
|
+
type ChannelChatMessage = EventConfig<{
|
|
11
|
+
Type: "channel.chat.message"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when a user sends a message to a specific chat room. */
|
|
14
|
+
Condition: {
|
|
15
|
+
/** The User ID of the channel to receive chat message events for. */
|
|
16
|
+
broadcaster_user_id: string
|
|
17
|
+
/** The User ID to read chat as. */
|
|
18
|
+
user_id: string
|
|
19
|
+
}
|
|
20
|
+
/** The event fired when a user sends a message to a specific chat room. */
|
|
21
|
+
Event: {
|
|
22
|
+
/** The broadcaster user ID. */
|
|
23
|
+
broadcaster_user_id: string
|
|
24
|
+
/** The broadcaster display name. */
|
|
25
|
+
broadcaster_user_name: string
|
|
26
|
+
/** The broadcaster login. */
|
|
27
|
+
broadcaster_user_login: string
|
|
28
|
+
/** The user ID of the user that sent the message. */
|
|
29
|
+
chatter_user_id: string
|
|
30
|
+
/** The user name of the user that sent the message. */
|
|
31
|
+
chatter_user_name: string
|
|
32
|
+
/** The user login of the user that sent the message. */
|
|
33
|
+
chatter_user_login: string
|
|
34
|
+
/** A UUID that identifies the message. */
|
|
35
|
+
message_id: string
|
|
36
|
+
/** The structured chat message. */
|
|
37
|
+
message: {
|
|
38
|
+
/** The chat message in plain text. */
|
|
39
|
+
text: string
|
|
40
|
+
/** Ordered list of chat message fragments. */
|
|
41
|
+
fragments: Array<{
|
|
42
|
+
/**
|
|
43
|
+
* The type of message fragment. Possible values:
|
|
44
|
+
* - text
|
|
45
|
+
* - cheermote
|
|
46
|
+
* - emote
|
|
47
|
+
* - mention
|
|
48
|
+
*/
|
|
49
|
+
type: string
|
|
50
|
+
/** Message text in fragment. */
|
|
51
|
+
text: string
|
|
52
|
+
/** Metadata pertaining to the cheermote. */
|
|
53
|
+
cheermote?: {
|
|
54
|
+
/** 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}. */
|
|
55
|
+
prefix: string
|
|
56
|
+
/** The amount of Bits cheered. */
|
|
57
|
+
bits: number
|
|
58
|
+
/** The tier level of the cheermote. */
|
|
59
|
+
tier: number
|
|
60
|
+
}
|
|
61
|
+
/** Metadata pertaining to the emote. */
|
|
62
|
+
emote?: {
|
|
63
|
+
/** An ID that uniquely identifies this emote. */
|
|
64
|
+
id: string
|
|
65
|
+
/** An ID that identifies the emote set that the emote belongs to. */
|
|
66
|
+
emote_set_id: string
|
|
67
|
+
/** The ID of the broadcaster who owns the emote. */
|
|
68
|
+
owner_id: string
|
|
69
|
+
/**
|
|
70
|
+
* The formats that the emote is available in.
|
|
71
|
+
* - animated - An animated GIF is available for this emote.
|
|
72
|
+
* - static - A static PNG file is available for this emote.
|
|
73
|
+
*/
|
|
74
|
+
format: string[]
|
|
75
|
+
}
|
|
76
|
+
/** Metadata pertaining to the mention. */
|
|
77
|
+
mention?: {
|
|
78
|
+
/** The user ID of the mentioned user. */
|
|
79
|
+
user_id: string
|
|
80
|
+
/** The user name of the mentioned user. */
|
|
81
|
+
user_name: string
|
|
82
|
+
/** The user login of the mentioned user. */
|
|
83
|
+
user_login: string
|
|
84
|
+
}
|
|
85
|
+
}>
|
|
86
|
+
}
|
|
87
|
+
/** The type of message. Possible values: <ul><li>text</li><li>channel_points_highlighted</li><li>channel_points_sub_only</li><li>user_intro</li><li>power_ups_message_effect</li><li>power_ups_gigantified_emote</li></ul> */
|
|
88
|
+
message_type: string
|
|
89
|
+
/** List of chat badges. */
|
|
90
|
+
badges: Array<{
|
|
91
|
+
/** An ID that identifies this set of chat badges. */
|
|
92
|
+
set_id: string
|
|
93
|
+
/** An ID that identifies this version of the badge. The ID can be any value. */
|
|
94
|
+
id: string
|
|
95
|
+
/** Contains metadata related to the chat badges in the badges tag. Currently, this tag contains metadata only for subscriber badges, to indicate the number of months the user has been a subscriber. */
|
|
96
|
+
info: string
|
|
97
|
+
}>
|
|
98
|
+
/** Metadata if this message is a cheer. */
|
|
99
|
+
cheer?: {
|
|
100
|
+
/** The amount of Bits the user cheered. */
|
|
101
|
+
bits: number
|
|
102
|
+
}
|
|
103
|
+
/** The color of the user's name in the chat room. This is a hexadecimal RGB color code in the form, #<RGB>. This tag may be empty if it is never set. */
|
|
104
|
+
color: string
|
|
105
|
+
/** Metadata if this message is a reply. */
|
|
106
|
+
reply?: {
|
|
107
|
+
/** An ID that uniquely identifies the parent message that this message is replying to. */
|
|
108
|
+
parent_message_id: string
|
|
109
|
+
/** The message body of the parent message. */
|
|
110
|
+
parent_message_body: string
|
|
111
|
+
/** User ID of the sender of the parent message. */
|
|
112
|
+
parent_user_id: string
|
|
113
|
+
/** User name of the sender of the parent message. */
|
|
114
|
+
parent_user_name: string
|
|
115
|
+
/** User login of the sender of the parent message. */
|
|
116
|
+
parent_user_login: string
|
|
117
|
+
/** An ID that identifies the parent message of the reply thread. */
|
|
118
|
+
thread_message_id: string
|
|
119
|
+
/** User ID of the sender of the thread's parent message. */
|
|
120
|
+
thread_user_id: string
|
|
121
|
+
/** User name of the sender of the thread's parent message. */
|
|
122
|
+
thread_user_name: string
|
|
123
|
+
/** User login of the sender of the thread's parent message. */
|
|
124
|
+
thread_user_login: string
|
|
125
|
+
}
|
|
126
|
+
/** The ID of a channel points custom reward that was redeemed. */
|
|
127
|
+
channel_points_custom_reward_id?: string
|
|
128
|
+
/** The broadcaster user ID of the channel the message was sent from. Is null when the message happens in the same channel as the broadcaster. Is not null when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster. */
|
|
129
|
+
source_broadcaster_user_id?: string
|
|
130
|
+
/** The user name of the broadcaster of the channel the message was sent from. Is null when the message happens in the same channel as the broadcaster. Is not null when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster. */
|
|
131
|
+
source_broadcaster_user_name?: string
|
|
132
|
+
/** The login of the broadcaster of the channel the message was sent from. Is null when the message happens in the same channel as the broadcaster. Is not null when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster. */
|
|
133
|
+
source_broadcaster_user_login?: string
|
|
134
|
+
/** The UUID that identifies the source message from the channel the message was sent from. Is null when the message happens in the same channel as the broadcaster. Is not null when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster. */
|
|
135
|
+
source_message_id?: string
|
|
136
|
+
/** The list of chat badges for the chatter in the channel the message was sent from. Is null when the message happens in the same channel as the broadcaster. Is not null when in a shared chat session, and the action happens in the channel of a participant other than the broadcaster. */
|
|
137
|
+
source_badges?: {
|
|
138
|
+
/** The ID that identifies this set of chat badges. */
|
|
139
|
+
set_id: string
|
|
140
|
+
/** The ID that identifies this version of the badge. The ID can be any value. */
|
|
141
|
+
id: string
|
|
142
|
+
/** Contains metadata related to the chat badges in the badges tag. Currently, this tag contains metadata only for subscriber badges, to indicate the number of months the user has been a subscriber. */
|
|
143
|
+
info: string
|
|
144
|
+
}
|
|
145
|
+
/** Determines if a message delivered during a shared chat session is only sent to the source channel. Has no effect if the message is not sent during a shared chat session. */
|
|
146
|
+
is_source_only?: boolean
|
|
147
|
+
}
|
|
148
|
+
}>
|
|
149
|
+
|
|
150
|
+
registerEvent("channel.chat.message", {
|
|
151
|
+
scopes: ["user:read:chat"],
|
|
152
|
+
subscriber: (userId) => ({
|
|
153
|
+
type: "channel.chat.message",
|
|
154
|
+
version: "1",
|
|
155
|
+
condition: {
|
|
156
|
+
broadcaster_user_id: userId,
|
|
157
|
+
user_id: userId,
|
|
158
|
+
},
|
|
159
|
+
}),
|
|
160
|
+
})
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type EventConfig, registerEvent } from "../events-helpers.ts"
|
|
2
|
+
|
|
3
|
+
declare module "../events-helpers.ts" {
|
|
4
|
+
interface EventConfigs {
|
|
5
|
+
"channel.chat.message_delete": ChannelChatMessageDelete
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Channel Chat Message Delete v1: When a moderator has removed a specific message. */
|
|
10
|
+
type ChannelChatMessageDelete = EventConfig<{
|
|
11
|
+
Type: "channel.chat.message_delete"
|
|
12
|
+
Version: "1"
|
|
13
|
+
/** The conditions to listen for when a moderator has removed a specific message. */
|
|
14
|
+
Condition: {
|
|
15
|
+
/** User ID of the channel to receive chat message delete events for. */
|
|
16
|
+
broadcaster_user_id: string
|
|
17
|
+
/** The user ID to read chat as. */
|
|
18
|
+
user_id: string
|
|
19
|
+
}
|
|
20
|
+
/** The event fired when a moderator has removed a specific message. */
|
|
21
|
+
Event: {
|
|
22
|
+
/** The broadcaster user ID. */
|
|
23
|
+
broadcaster_user_id: string
|
|
24
|
+
/** The broadcaster display name. */
|
|
25
|
+
broadcaster_user_name: string
|
|
26
|
+
/** The broadcaster login. */
|
|
27
|
+
broadcaster_user_login: string
|
|
28
|
+
/** The ID of the user whose message was deleted. */
|
|
29
|
+
target_user_id: string
|
|
30
|
+
/** The user name of the user whose message was deleted. */
|
|
31
|
+
target_user_name: string
|
|
32
|
+
/** The user login of the user whose message was deleted. */
|
|
33
|
+
target_user_login: string
|
|
34
|
+
/** A UUID that identifies the message that was removed. */
|
|
35
|
+
message_id: string
|
|
36
|
+
}
|
|
37
|
+
}>
|
|
38
|
+
|
|
39
|
+
registerEvent("channel.chat.message_delete", {
|
|
40
|
+
scopes: ["user:read:chat"],
|
|
41
|
+
subscriber: (userId) => ({
|
|
42
|
+
type: "channel.chat.message_delete",
|
|
43
|
+
version: "1",
|
|
44
|
+
condition: {
|
|
45
|
+
broadcaster_user_id: userId,
|
|
46
|
+
user_id: userId,
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
})
|