@overlaysymphony/twitch 0.1.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.
Files changed (95) hide show
  1. package/README.md +9 -0
  2. package/package.json +40 -0
  3. package/src/authentication/authentication.ts +107 -0
  4. package/src/authentication/index.ts +1 -0
  5. package/src/chat/chat.ts +160 -0
  6. package/src/chat/index.ts +6 -0
  7. package/src/chat/interfaces/events.ts +269 -0
  8. package/src/chat/interfaces/index.ts +9 -0
  9. package/src/chat/parser.ts +265 -0
  10. package/src/eventsub/events/channel.ad_break.begin.ts +51 -0
  11. package/src/eventsub/events/channel.ban.ts +59 -0
  12. package/src/eventsub/events/channel.channel_points_custom_reward._.ts +29 -0
  13. package/src/eventsub/events/channel.channel_points_custom_reward.add.ts +75 -0
  14. package/src/eventsub/events/channel.channel_points_custom_reward.remove.ts +77 -0
  15. package/src/eventsub/events/channel.channel_points_custom_reward.update.ts +77 -0
  16. package/src/eventsub/events/channel.channel_points_custom_reward_redemption._.ts +10 -0
  17. package/src/eventsub/events/channel.channel_points_custom_reward_redemption.add.ts +59 -0
  18. package/src/eventsub/events/channel.channel_points_custom_reward_redemption.update.ts +59 -0
  19. package/src/eventsub/events/channel.charity_campaign.donate.ts +66 -0
  20. package/src/eventsub/events/channel.charity_campaign.progress.ts +67 -0
  21. package/src/eventsub/events/channel.charity_campaign.start.ts +69 -0
  22. package/src/eventsub/events/channel.charity_campaign.stop.ts +69 -0
  23. package/src/eventsub/events/channel.chat.clear.ts +42 -0
  24. package/src/eventsub/events/channel.chat.clear_user_messages.ts +48 -0
  25. package/src/eventsub/events/channel.chat.message_delete.ts +50 -0
  26. package/src/eventsub/events/channel.chat.notification.ts +50 -0
  27. package/src/eventsub/events/channel.cheer.ts +51 -0
  28. package/src/eventsub/events/channel.follow.ts +50 -0
  29. package/src/eventsub/events/channel.goal.begin.ts +51 -0
  30. package/src/eventsub/events/channel.goal.end.ts +55 -0
  31. package/src/eventsub/events/channel.goal.progress.ts +51 -0
  32. package/src/eventsub/events/channel.guest_star_guest.update.ts +66 -0
  33. package/src/eventsub/events/channel.guest_star_session.begin.ts +46 -0
  34. package/src/eventsub/events/channel.guest_star_session.end.ts +48 -0
  35. package/src/eventsub/events/channel.guest_star_settings.update.ts +50 -0
  36. package/src/eventsub/events/channel.hype_train._.ts +12 -0
  37. package/src/eventsub/events/channel.hype_train.begin.ts +57 -0
  38. package/src/eventsub/events/channel.hype_train.end.ts +55 -0
  39. package/src/eventsub/events/channel.hype_train.progress.ts +70 -0
  40. package/src/eventsub/events/channel.moderator.add.ts +45 -0
  41. package/src/eventsub/events/channel.moderator.remove.ts +45 -0
  42. package/src/eventsub/events/channel.poll._.ts +26 -0
  43. package/src/eventsub/events/channel.poll.begin.ts +55 -0
  44. package/src/eventsub/events/channel.poll.end.ts +57 -0
  45. package/src/eventsub/events/channel.poll.progress.ts +55 -0
  46. package/src/eventsub/events/channel.prediction._.ts +25 -0
  47. package/src/eventsub/events/channel.prediction.begin.ts +51 -0
  48. package/src/eventsub/events/channel.prediction.end.ts +55 -0
  49. package/src/eventsub/events/channel.prediction.lock.ts +51 -0
  50. package/src/eventsub/events/channel.prediction.progress.ts +51 -0
  51. package/src/eventsub/events/channel.raid.ts +49 -0
  52. package/src/eventsub/events/channel.shield_mode.begin.ts +50 -0
  53. package/src/eventsub/events/channel.shield_mode.end.ts +50 -0
  54. package/src/eventsub/events/channel.shoutout.create.ts +62 -0
  55. package/src/eventsub/events/channel.shoutout.receive.ts +52 -0
  56. package/src/eventsub/events/channel.subscribe.ts +49 -0
  57. package/src/eventsub/events/channel.subscription.end.ts +49 -0
  58. package/src/eventsub/events/channel.subscription.gift.ts +53 -0
  59. package/src/eventsub/events/channel.subscription.message.ts +67 -0
  60. package/src/eventsub/events/channel.unban.ts +51 -0
  61. package/src/eventsub/events/channel.update.ts +49 -0
  62. package/src/eventsub/events/index.ts +284 -0
  63. package/src/eventsub/events/stream.offline.ts +39 -0
  64. package/src/eventsub/events/stream.online.ts +45 -0
  65. package/src/eventsub/events/user.update.ts +45 -0
  66. package/src/eventsub/events-helpers.ts +29 -0
  67. package/src/eventsub/eventsub.ts +88 -0
  68. package/src/eventsub/index.ts +7 -0
  69. package/src/eventsub/messages.ts +34 -0
  70. package/src/helix/channel-points/custom-rewards.ts +63 -0
  71. package/src/helix/channel-points/index.ts +1 -0
  72. package/src/helix/helix.ts +89 -0
  73. package/src/helix/subscriptions/index.ts +1 -0
  74. package/src/helix/subscriptions/subscriptions.ts +122 -0
  75. package/src/helix/users/index.ts +1 -0
  76. package/src/helix/users/users.ts +42 -0
  77. package/src/helpers/alerts/alerts.ts +60 -0
  78. package/src/helpers/alerts/index.ts +2 -0
  79. package/src/helpers/charity/charity.ts +89 -0
  80. package/src/helpers/charity/index.ts +1 -0
  81. package/src/helpers/goal/goal.ts +38 -0
  82. package/src/helpers/goal/index.ts +1 -0
  83. package/src/helpers/hype-train/hype-train.ts +51 -0
  84. package/src/helpers/hype-train/index.ts +1 -0
  85. package/src/helpers/poll/index.ts +1 -0
  86. package/src/helpers/poll/poll.ts +63 -0
  87. package/src/helpers/prediction/index.ts +1 -0
  88. package/src/helpers/prediction/prediction.ts +66 -0
  89. package/src/helpers/redemption/index.ts +1 -0
  90. package/src/helpers/redemption/redemption.ts +42 -0
  91. package/src/helpers/status/index.ts +1 -0
  92. package/src/helpers/status/status.ts +61 -0
  93. package/src/setupTests.ts +0 -0
  94. package/src/ui/authentication.ts +230 -0
  95. package/src/ui/popup.ts +115 -0
@@ -0,0 +1,59 @@
1
+ import { BaseSubscription } from "../events-helpers.js"
2
+
3
+ import { ChannelPointsCustomRewardRedemptionReward } from "./channel.channel_points_custom_reward_redemption._.js"
4
+
5
+ type ChannelPointsCustomRewardRedemptionAddType = "channel.channel_points_custom_reward_redemption.add"
6
+ type ChannelPointsCustomRewardRedemptionAddVersion = "1"
7
+
8
+ /** The parameters under which an event fires when A user redeems a custom channel points reward. */
9
+ export interface ChannelPointsCustomRewardRedemptionAddCondition {
10
+ /** The user ID of the broadcaster. */
11
+ broadcaster_user_id: string
12
+ /** Optional. Specify a reward ID to only receive notifications for a specific reward. */
13
+ reward_id?: string
14
+ }
15
+
16
+ /** The event information when A user redeems a custom channel points reward. */
17
+ export interface ChannelPointsCustomRewardRedemptionAddEvent {
18
+ /** The redemption identifier. */
19
+ id: string
20
+ /** The user ID of the broadcaster. */
21
+ broadcaster_user_id: string
22
+ /** The user login of the broadcaster. */
23
+ broadcaster_user_login: string
24
+ /** The user name of the broadcaster. */
25
+ broadcaster_user_name: string
26
+ /** The user ID of the user who redeemed the reward. */
27
+ user_id: string
28
+ /** The user login of the user who redeemed the reward. */
29
+ user_login: string
30
+ /** The user name of the user who redeemed the reward. */
31
+ user_name: string
32
+ /** The user input provided. Empty string if not provided. */
33
+ user_input: string
34
+ /** Defaults to unfulfilled. Possible values are unknown, unfulfilled, fulfilled, and canceled. */
35
+ status: string
36
+ /** Basic information about the reward that was redeemed, at the time it was redeemed. */
37
+ reward: ChannelPointsCustomRewardRedemptionReward
38
+ /** The time the reward was redeemed. */
39
+ redeemed_at: Date
40
+ }
41
+
42
+ /** The event notification received when A user redeems a custom channel points reward. */
43
+ export type ChannelPointsCustomRewardRedemptionAddSubscription = BaseSubscription<
44
+ ChannelPointsCustomRewardRedemptionAddType,
45
+ ChannelPointsCustomRewardRedemptionAddVersion,
46
+ ChannelPointsCustomRewardRedemptionAddCondition
47
+ >
48
+
49
+ export function makeChannelPointsCustomRewardRedemptionAddSubscription(
50
+ userId: string,
51
+ ): ChannelPointsCustomRewardRedemptionAddSubscription {
52
+ return {
53
+ type: "channel.channel_points_custom_reward_redemption.add",
54
+ version: "1",
55
+ condition: {
56
+ broadcaster_user_id: userId,
57
+ },
58
+ }
59
+ }
@@ -0,0 +1,59 @@
1
+ import { BaseSubscription } from "../events-helpers.js"
2
+
3
+ import { ChannelPointsCustomRewardRedemptionReward } from "./channel.channel_points_custom_reward_redemption._.js"
4
+
5
+ type ChannelPointsCustomRewardRedemptionUpdateType = "channel.channel_points_custom_reward_redemption.update"
6
+ type ChannelPointsCustomRewardRedemptionUpdateVersion = "1"
7
+
8
+ /** The parameters under which an event fires when A moderator updates the redemption of a channel points custom reward. */
9
+ export interface ChannelPointsCustomRewardRedemptionUpdateCondition {
10
+ /** The user ID of the broadcaster. */
11
+ broadcaster_user_id: string
12
+ /** Optional. Specify a reward ID to only receive notifications for a specific reward. */
13
+ reward_id?: string
14
+ }
15
+
16
+ /** The event information when A moderator updates the redemption of a channel points custom reward. */
17
+ export interface ChannelPointsCustomRewardRedemptionUpdateEvent {
18
+ /** The redemption identifier. */
19
+ id: string
20
+ /** The user ID of the broadcaster. */
21
+ broadcaster_user_id: string
22
+ /** The user login of the broadcaster. */
23
+ broadcaster_user_login: string
24
+ /** The user name of the broadcaster. */
25
+ broadcaster_user_name: string
26
+ /** The user ID of the user who redeemed the reward. */
27
+ user_id: string
28
+ /** The user login of the user who redeemed the reward. */
29
+ user_login: string
30
+ /** The user name of the user who redeemed the reward. */
31
+ user_name: string
32
+ /** The user input provided. Empty string if not provided. */
33
+ user_input: string
34
+ /** Will be fulfilled or canceled. Possible values are unknown, unfulfilled, fulfilled, and canceled. */
35
+ status: string
36
+ /** Basic information about the reward that was redeemed, at the time it was redeemed. */
37
+ reward: ChannelPointsCustomRewardRedemptionReward
38
+ /** The time the reward was redeemed. */
39
+ redeemed_at: Date
40
+ }
41
+
42
+ /** The event notification received when A moderator updates the redemption of a channel points custom reward. */
43
+ export type ChannelPointsCustomRewardRedemptionUpdateSubscription = BaseSubscription<
44
+ ChannelPointsCustomRewardRedemptionUpdateType,
45
+ ChannelPointsCustomRewardRedemptionUpdateVersion,
46
+ ChannelPointsCustomRewardRedemptionUpdateCondition
47
+ >
48
+
49
+ export function makeChannelPointsCustomRewardRedemptionUpdateSubscription(
50
+ userId: string,
51
+ ): ChannelPointsCustomRewardRedemptionUpdateSubscription {
52
+ return {
53
+ type: "channel.channel_points_custom_reward_redemption.update",
54
+ version: "1",
55
+ condition: {
56
+ broadcaster_user_id: userId,
57
+ },
58
+ }
59
+ }
@@ -0,0 +1,66 @@
1
+ import { BaseSubscription } from "../events-helpers.js"
2
+
3
+ type CharityDonationType = "channel.charity_campaign.donate"
4
+ type CharityDonationVersion = "1"
5
+
6
+ /** The parameters under which an event fires when A user donates to the broadcaster's charity campaign. */
7
+ export interface CharityDonationCondition {
8
+ /** The user ID of the broadcaster. */
9
+ broadcaster_user_id: string
10
+ }
11
+
12
+ /** The event information when A user donates to the broadcaster's charity campaign. */
13
+ export interface CharityDonationEvent {
14
+ /** An ID of the donation. The ID is unique across campaigns. */
15
+ id: string
16
+ /** The ID of the charity campaign. */
17
+ campaign_id: string
18
+ /** The user ID of the broadcaster. */
19
+ broadcaster_id: string
20
+ /** The user login of the broadcaster. */
21
+ broadcaster_login: string
22
+ /** The user name of the broadcaster. */
23
+ broadcaster_name: string
24
+ /** The user ID of the user who donated to the campaign. */
25
+ user_id: string
26
+ /** The user login of the user who donated to the campaign. */
27
+ user_login: string
28
+ /** The user name of the user who donated to the campaign. */
29
+ user_name: string
30
+ /** The charity's name. */
31
+ charity_name: string
32
+ /** A description of the charity. */
33
+ charity_description: string
34
+ /** A URL to an image of the charity's logo. The image's type is PNG and its size is 100px X 100px. */
35
+ charity_logo: string
36
+ /** A URL to the charity's website. */
37
+ charity_website: string
38
+ /** An object that contains the current amount of donations that the campaign has received. */
39
+ amount: {
40
+ /** Integer. The monetary amount. The amount is specified in the currency's minor unit. For example, the minor units for USD is cents, so if the amount is $5.50 USD, value is set to 550. */
41
+ value: number
42
+ /** Integer. The number of decimal places used by the currency. For example, USD uses two decimal places. Use this number to translate value from minor units to major units by using the formula:\n\nvalue / 10^decimal_places */
43
+ decimal_places: number
44
+ /** The ISO-4217 three-letter currency code that identifies the type of currency in value. */
45
+ currency: string
46
+ }
47
+ }
48
+
49
+ /** The event notification received when A user donates to the broadcaster's charity campaign. */
50
+ export type CharityDonationSubscription = BaseSubscription<
51
+ CharityDonationType,
52
+ CharityDonationVersion,
53
+ CharityDonationCondition
54
+ >
55
+
56
+ export function makeCharityDonationSubscription(
57
+ userId: string,
58
+ ): CharityDonationSubscription {
59
+ return {
60
+ type: "channel.charity_campaign.donate",
61
+ version: "1",
62
+ condition: {
63
+ broadcaster_user_id: userId,
64
+ },
65
+ }
66
+ }
@@ -0,0 +1,67 @@
1
+ import { BaseSubscription } from "../events-helpers.js"
2
+
3
+ type CharityCampaignProgressType = "channel.charity_campaign.progress"
4
+ type CharityCampaignProgressVersion = "1"
5
+
6
+ /** The parameters under which an event fires when Progress is made towards the campaign's goal or when the broadcaster changes the fundraising goal. */
7
+ export interface CharityCampaignProgressCondition {
8
+ /** The user ID of the broadcaster. */
9
+ broadcaster_user_id: string
10
+ }
11
+
12
+ /** The event information when Progress is made towards the campaign's goal or when the broadcaster changes the fundraising goal. */
13
+ export interface CharityCampaignProgressEvent {
14
+ /** The ID of the charity campaign. */
15
+ id: string
16
+ /** The user ID of the broadcaster. */
17
+ broadcaster_id: string
18
+ /** The user login of the broadcaster. */
19
+ broadcaster_login: string
20
+ /** The user name of the broadcaster. */
21
+ broadcaster_name: string
22
+ /** The charity's name. */
23
+ charity_name: string
24
+ /** A description of the charity. */
25
+ charity_description: string
26
+ /** A URL to an image of the charity's logo. The image's type is PNG and its size is 100px X 100px. */
27
+ charity_logo: string
28
+ /** A URL to the charity's website. */
29
+ charity_website: string
30
+ /** An object that contains the current amount of donations that the campaign has received. */
31
+ current_amount: {
32
+ /** Integer. The monetary amount. The amount is specified in the currency's minor unit. For example, the minor units for USD is cents, so if the amount is $5.50 USD, value is set to 550. */
33
+ value: number
34
+ /** Integer. The number of decimal places used by the currency. For example, USD uses two decimal places. Use this number to translate value from minor units to major units by using the formula:\n\nvalue / 10^decimal_places */
35
+ decimal_places: number
36
+ /** The ISO-4217 three-letter currency code that identifies the type of currency in value. */
37
+ currency: string
38
+ }
39
+ /** An object that contains the campaign's target fundraising goal. */
40
+ target_amount: {
41
+ /** Integer. The monetary amount. The amount is specified in the currency's minor unit. For example, the minor units for USD is cents, so if the amount is $5.50 USD, value is set to 550. */
42
+ value: number
43
+ /** Integer. The number of decimal places used by the currency. For example, USD uses two decimal places. Use this number to translate value from minor units to major units by using the formula:\n\nvalue / 10^decimal_places */
44
+ decimal_places: number
45
+ /** The ISO-4217 three-letter currency code that identifies the type of currency in value. */
46
+ currency: string
47
+ }
48
+ }
49
+
50
+ /** The event notification received when Progress is made towards the campaign's goal or when the broadcaster changes the fundraising goal. */
51
+ export type CharityCampaignProgressSubscription = BaseSubscription<
52
+ CharityCampaignProgressType,
53
+ CharityCampaignProgressVersion,
54
+ CharityCampaignProgressCondition
55
+ >
56
+
57
+ export function makeCharityCampaignProgressSubscription(
58
+ userId: string,
59
+ ): CharityCampaignProgressSubscription {
60
+ return {
61
+ type: "channel.charity_campaign.progress",
62
+ version: "1",
63
+ condition: {
64
+ broadcaster_user_id: userId,
65
+ },
66
+ }
67
+ }
@@ -0,0 +1,69 @@
1
+ import { BaseSubscription } from "../events-helpers.js"
2
+
3
+ type CharityCampaignStartType = "channel.charity_campaign.start"
4
+ type CharityCampaignStartVersion = "1"
5
+
6
+ /** The parameters under which an event fires when The broadcaster starts a charity campaign. */
7
+ export interface CharityCampaignStartCondition {
8
+ /** The user ID of the broadcaster. */
9
+ broadcaster_user_id: string
10
+ }
11
+
12
+ /** The event information when The broadcaster starts a charity campaign. */
13
+ export interface CharityCampaignStartEvent {
14
+ /** The ID of the charity campaign. */
15
+ id: string
16
+ /** The user ID of the broadcaster. */
17
+ broadcaster_id: string
18
+ /** The user login of the broadcaster. */
19
+ broadcaster_login: string
20
+ /** The user name of the broadcaster. */
21
+ broadcaster_name: string
22
+ /** The charity's name. */
23
+ charity_name: string
24
+ /** A description of the charity. */
25
+ charity_description: string
26
+ /** A URL to an image of the charity's logo. The image's type is PNG and its size is 100px X 100px. */
27
+ charity_logo: string
28
+ /** A URL to the charity's website. */
29
+ charity_website: string
30
+ /** An object that contains the current amount of donations that the campaign has received. */
31
+ current_amount: {
32
+ /** Integer. The monetary amount. The amount is specified in the currency's minor unit. For example, the minor units for USD is cents, so if the amount is $5.50 USD, value is set to 550. */
33
+ value: number
34
+ /** Integer. The number of decimal places used by the currency. For example, USD uses two decimal places. Use this number to translate value from minor units to major units by using the formula:\n\nvalue / 10^decimal_places */
35
+ decimal_places: number
36
+ /** The ISO-4217 three-letter currency code that identifies the type of currency in value. */
37
+ currency: string
38
+ }
39
+ /** An object that contains the campaign's target fundraising goal. */
40
+ target_amount: {
41
+ /** Integer. The monetary amount. The amount is specified in the currency's minor unit. For example, the minor units for USD is cents, so if the amount is $5.50 USD, value is set to 550. */
42
+ value: number
43
+ /** Integer. The number of decimal places used by the currency. For example, USD uses two decimal places. Use this number to translate value from minor units to major units by using the formula:\n\nvalue / 10^decimal_places */
44
+ decimal_places: number
45
+ /** The ISO-4217 three-letter currency code that identifies the type of currency in value. */
46
+ currency: string
47
+ }
48
+ /** The time the broadcaster started the campaign. */
49
+ started_at: Date
50
+ }
51
+
52
+ /** The event notification received when The broadcaster starts a charity campaign. */
53
+ export type CharityCampaignStartSubscription = BaseSubscription<
54
+ CharityCampaignStartType,
55
+ CharityCampaignStartVersion,
56
+ CharityCampaignStartCondition
57
+ >
58
+
59
+ export function makeCharityCampaignStartSubscription(
60
+ userId: string,
61
+ ): CharityCampaignStartSubscription {
62
+ return {
63
+ type: "channel.charity_campaign.start",
64
+ version: "1",
65
+ condition: {
66
+ broadcaster_user_id: userId,
67
+ },
68
+ }
69
+ }
@@ -0,0 +1,69 @@
1
+ import { BaseSubscription } from "../events-helpers.js"
2
+
3
+ type CharityCampaignStopType = "channel.charity_campaign.stop"
4
+ type CharityCampaignStopVersion = "1"
5
+
6
+ /** The parameters under which an event fires when The broadcaster stops a charity campaign. */
7
+ export interface CharityCampaignStopCondition {
8
+ /** The user ID of the broadcaster. */
9
+ broadcaster_user_id: string
10
+ }
11
+
12
+ /** The event information when The broadcaster stops a charity campaign. */
13
+ export interface CharityCampaignStopEvent {
14
+ /** The ID of the charity campaign. */
15
+ id: string
16
+ /** The user ID of the broadcaster. */
17
+ broadcaster_id: string
18
+ /** The user login of the broadcaster. */
19
+ broadcaster_login: string
20
+ /** The user name of the broadcaster. */
21
+ broadcaster_name: string
22
+ /** The charity's name. */
23
+ charity_name: string
24
+ /** A description of the charity. */
25
+ charity_description: string
26
+ /** A URL to an image of the charity's logo. The image's type is PNG and its size is 100px X 100px. */
27
+ charity_logo: string
28
+ /** A URL to the charity's website. */
29
+ charity_website: string
30
+ /** An object that contains the current amount of donations that the campaign has received. */
31
+ current_amount: {
32
+ /** Integer. The monetary amount. The amount is specified in the currency's minor unit. For example, the minor units for USD is cents, so if the amount is $5.50 USD, value is set to 550. */
33
+ value: number
34
+ /** Integer. The number of decimal places used by the currency. For example, USD uses two decimal places. Use this number to translate value from minor units to major units by using the formula:\n\nvalue / 10^decimal_places */
35
+ decimal_places: number
36
+ /** The ISO-4217 three-letter currency code that identifies the type of currency in value. */
37
+ currency: string
38
+ }
39
+ /** An object that contains the campaign's target fundraising goal. */
40
+ target_amount: {
41
+ /** Integer. The monetary amount. The amount is specified in the currency's minor unit. For example, the minor units for USD is cents, so if the amount is $5.50 USD, value is set to 550. */
42
+ value: number
43
+ /** Integer. The number of decimal places used by the currency. For example, USD uses two decimal places. Use this number to translate value from minor units to major units by using the formula:\n\nvalue / 10^decimal_places */
44
+ decimal_places: number
45
+ /** The ISO-4217 three-letter currency code that identifies the type of currency in value. */
46
+ currency: string
47
+ }
48
+ /** The time the broadcaster stopped the campaign. */
49
+ stopped_at: Date
50
+ }
51
+
52
+ /** The event notification received when The broadcaster stops a charity campaign. */
53
+ export type CharityCampaignStopSubscription = BaseSubscription<
54
+ CharityCampaignStopType,
55
+ CharityCampaignStopVersion,
56
+ CharityCampaignStopCondition
57
+ >
58
+
59
+ export function makeCharityCampaignStopSubscription(
60
+ userId: string,
61
+ ): CharityCampaignStopSubscription {
62
+ return {
63
+ type: "channel.charity_campaign.stop",
64
+ version: "1",
65
+ condition: {
66
+ broadcaster_user_id: userId,
67
+ },
68
+ }
69
+ }
@@ -0,0 +1,42 @@
1
+ import { BaseSubscription } from "../events-helpers.js"
2
+
3
+ type ChannelChatClearType = "channel.chat.clear"
4
+ type ChannelChatClearVersion = "1"
5
+
6
+ /** The parameters under which an event fires when A moderator clears all messages from the chat room. */
7
+ export interface ChannelChatClearCondition {
8
+ /** The user ID of the broadcaster. */
9
+ broadcaster_user_id: string
10
+ /** The user ID to read chat as. */
11
+ user_id: string
12
+ }
13
+
14
+ /** The event information when A moderator clears all messages from the chat room. */
15
+ export interface ChannelChatClearEvent {
16
+ /** The user ID of the broadcaster. */
17
+ broadcaster_user_id: string
18
+ /** The user login of the broadcaster. */
19
+ broadcaster_user_login: string
20
+ /** The user name of the broadcaster. */
21
+ broadcaster_user_name: string
22
+ }
23
+
24
+ /** The event notification received when A moderator clears all messages from the chat room. */
25
+ export type ChannelChatClearSubscription = BaseSubscription<
26
+ ChannelChatClearType,
27
+ ChannelChatClearVersion,
28
+ ChannelChatClearCondition
29
+ >
30
+
31
+ export function makeChannelChatClearSubscription(
32
+ userId: string,
33
+ ): ChannelChatClearSubscription {
34
+ return {
35
+ type: "channel.chat.clear",
36
+ version: "1",
37
+ condition: {
38
+ broadcaster_user_id: userId,
39
+ user_id: userId,
40
+ },
41
+ }
42
+ }
@@ -0,0 +1,48 @@
1
+ import { BaseSubscription } from "../events-helpers.js"
2
+
3
+ type ChannelChatClearUserMessagesType = "channel.chat.clear_user_messages"
4
+ type ChannelChatClearUserMessagesVersion = "1"
5
+
6
+ /** The parameters under which an event fires when A moderator clears all messages from a specific user. */
7
+ export interface ChannelChatClearUserMessagesCondition {
8
+ /** The user ID of the broadcaster. */
9
+ broadcaster_user_id: string
10
+ /** The user ID to read chat as. */
11
+ user_id: string
12
+ }
13
+
14
+ /** The event information when A moderator clears all messages from a specific user. */
15
+ export interface ChannelChatClearUserMessagesEvent {
16
+ /** The user ID of the broadcaster. */
17
+ broadcaster_user_id: string
18
+ /** The user login of the broadcaster. */
19
+ broadcaster_user_login: string
20
+ /** The user name of the broadcaster. */
21
+ broadcaster_user_name: string
22
+ /** The user ID of the user who was banned or put in a timeout. */
23
+ target_user_id: string
24
+ /** The user name of the user who was banned or put in a timeout. */
25
+ target_user_login: string
26
+ /** The user login of the user who was banned or put in a timeout. */
27
+ target_user_name: string
28
+ }
29
+
30
+ /** The event notification received when A moderator clears all messages from a specific user. */
31
+ export type ChannelChatClearUserMessagesSubscription = BaseSubscription<
32
+ ChannelChatClearUserMessagesType,
33
+ ChannelChatClearUserMessagesVersion,
34
+ ChannelChatClearUserMessagesCondition
35
+ >
36
+
37
+ export function makeChannelChatClearUserMessagesSubscription(
38
+ userId: string,
39
+ ): ChannelChatClearUserMessagesSubscription {
40
+ return {
41
+ type: "channel.chat.clear_user_messages",
42
+ version: "1",
43
+ condition: {
44
+ broadcaster_user_id: userId,
45
+ user_id: userId,
46
+ },
47
+ }
48
+ }
@@ -0,0 +1,50 @@
1
+ import { BaseSubscription } from "../events-helpers.js"
2
+
3
+ type ChannelChatMessageDeleteType = "channel.chat.message_delete"
4
+ type ChannelChatMessageDeleteVersion = "1"
5
+
6
+ /** The parameters under which an event fires when A moderator removes a specific message. */
7
+ export interface ChannelChatMessageDeleteCondition {
8
+ /** The user ID of the broadcaster. */
9
+ broadcaster_user_id: string
10
+ /** The user ID to read chat as. */
11
+ user_id: string
12
+ }
13
+
14
+ /** The event information when A moderator removes a specific message. */
15
+ export interface ChannelChatMessageDeleteEvent {
16
+ /** The user ID of the broadcaster. */
17
+ broadcaster_user_id: string
18
+ /** The user login of the broadcaster. */
19
+ broadcaster_user_login: string
20
+ /** The user name of the broadcaster. */
21
+ broadcaster_user_name: string
22
+ /** The user ID of the user whose message was deleted. */
23
+ target_user_id: string
24
+ /** The user name of the user whose message was deleted. */
25
+ target_user_login: string
26
+ /** The user login of the user whose message was deleted. */
27
+ target_user_name: string
28
+ /** The UUID of the message that was removed. */
29
+ message_id: string
30
+ }
31
+
32
+ /** The event notification received when A moderator removes a specific message. */
33
+ export type ChannelChatMessageDeleteSubscription = BaseSubscription<
34
+ ChannelChatMessageDeleteType,
35
+ ChannelChatMessageDeleteVersion,
36
+ ChannelChatMessageDeleteCondition
37
+ >
38
+
39
+ export function makeChannelChatMessageDeleteSubscription(
40
+ userId: string,
41
+ ): ChannelChatMessageDeleteSubscription {
42
+ return {
43
+ type: "channel.chat.message_delete",
44
+ version: "1",
45
+ condition: {
46
+ broadcaster_user_id: userId,
47
+ user_id: userId,
48
+ },
49
+ }
50
+ }
@@ -0,0 +1,50 @@
1
+ import { BaseSubscription } from "../events-helpers.js"
2
+
3
+ type ChannelChatNotificationType = "channel.chat.notification"
4
+ type ChannelChatNotificationVersion = "1"
5
+
6
+ /** The parameters under which an event fires when An event appears in chat. */
7
+ export interface ChannelChatNotificationCondition {
8
+ /** The user ID of the broadcaster. */
9
+ broadcaster_user_id: string
10
+ /** The user ID to read chat as. */
11
+ user_id: string
12
+ }
13
+
14
+ /** The event information when An event appears in chat. */
15
+ export interface ChannelChatNotificationEvent {
16
+ /** The user ID of the broadcaster. */
17
+ broadcaster_user_id: string
18
+ /** The user login of the broadcaster. */
19
+ broadcaster_user_login: string
20
+ /** The user name of the broadcaster. */
21
+ broadcaster_user_name: string
22
+ /** The user ID of the user who sent the message. */
23
+ chatter_user_id: string
24
+ /** The user login of the user who sent the message. */
25
+ chatter_user_login: string
26
+ /** The user name of the user who sent the message. */
27
+ chatter_user_name: string
28
+ /** The UUID of the message. */
29
+ message_id: string
30
+ }
31
+
32
+ /** The event notification received when An event appears in chat. */
33
+ export type ChannelChatNotificationSubscription = BaseSubscription<
34
+ ChannelChatNotificationType,
35
+ ChannelChatNotificationVersion,
36
+ ChannelChatNotificationCondition
37
+ >
38
+
39
+ export function makeChannelChatNotificationSubscription(
40
+ userId: string,
41
+ ): ChannelChatNotificationSubscription {
42
+ return {
43
+ type: "channel.chat.notification",
44
+ version: "1",
45
+ condition: {
46
+ broadcaster_user_id: userId,
47
+ user_id: userId,
48
+ },
49
+ }
50
+ }
@@ -0,0 +1,51 @@
1
+ import { BaseSubscription } from "../events-helpers.js"
2
+
3
+ type ChannelCheerType = "channel.cheer"
4
+ type ChannelCheerVersion = "1"
5
+
6
+ /** The parameters under which an event fires when A user cheers. */
7
+ export interface ChannelCheerCondition {
8
+ /** The user ID of the broadcaster. */
9
+ broadcaster_user_id: string
10
+ }
11
+
12
+ /** The event information when A user cheers. */
13
+ export interface ChannelCheerEvent {
14
+ /** Whether the user cheered anonymously or not. */
15
+ is_anonymous: boolean
16
+ /** The user ID of the user who cheered. This is null if is_anonymous is true. */
17
+ user_id: string
18
+ /** The user login of the user who cheered. This is null if is_anonymous is true. */
19
+ user_login: string
20
+ /** The user name of the user who cheered. This is null if is_anonymous is true. */
21
+ user_name: string
22
+ /** The user ID of the broadcaster. */
23
+ broadcaster_user_id: string
24
+ /** The user login of the broadcaster. */
25
+ broadcaster_user_login: string
26
+ /** The user name of the broadcaster. */
27
+ broadcaster_user_name: string
28
+ /** The message sent with the cheer. */
29
+ message: string
30
+ /** Integer. The number of bits cheered. */
31
+ bits: number
32
+ }
33
+
34
+ /** The event notification received when A user cheers. */
35
+ export type ChannelCheerSubscription = BaseSubscription<
36
+ ChannelCheerType,
37
+ ChannelCheerVersion,
38
+ ChannelCheerCondition
39
+ >
40
+
41
+ export function makeChannelCheerSubscription(
42
+ userId: string,
43
+ ): ChannelCheerSubscription {
44
+ return {
45
+ type: "channel.cheer",
46
+ version: "1",
47
+ condition: {
48
+ broadcaster_user_id: userId,
49
+ },
50
+ }
51
+ }