Skip to content

Commit a57d0ce

Browse files
committed
add status to all eventsub payloads
also fixes VerificationRequest roundtrip
1 parent 8835442 commit a57d0ce

File tree

21 files changed

+102
-69
lines changed

21 files changed

+102
-69
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/eventsub/channel/ban.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ fn parse_payload() {
5959
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
6060
"type": "channel.ban",
6161
"version": "1",
62+
"status": "enabled",
6263
"condition": {
6364
"broadcaster_user_id": "1337"
6465
},

src/eventsub/channel/channel_points_custom_reward/add.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ pub struct ChannelPointsCustomRewardAddV1Payload {
3030
pub background_color: String,
3131
/// The requested broadcaster ID.
3232
pub broadcaster_user_id: types::UserId,
33-
/// The requested broadcaster name.
34-
pub broadcaster_user_name: types::UserName,
33+
/// The requested broadcaster login.
34+
pub broadcaster_user_login: types::UserName,
35+
/// The requested broadcaster display name.
36+
pub broadcaster_user_name: types::DisplayName,
3537
/// Timestamp of the cooldown expiration. null if the reward isn’t on cooldown.
3638
pub cooldown_expires_at: Option<types::Timestamp>,
3739
/// The reward cost.
@@ -74,6 +76,7 @@ fn parse_payload() {
7476
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
7577
"type": "channel.channel_points_custom_reward.add",
7678
"version": "1",
79+
"status": "enabled",
7780
"condition": {
7881
"broadcaster_user_id": "1337"
7982
},
@@ -86,7 +89,8 @@ fn parse_payload() {
8689
"event": {
8790
"id": "9001",
8891
"broadcaster_user_id": "1337",
89-
"broadcaster_user_name": "cool_user",
92+
"broadcaster_user_login": "cool_user",
93+
"broadcaster_user_name": "Cool_User",
9094
"is_enabled": true,
9195
"is_paused": false,
9296
"is_in_stock": true,

src/eventsub/channel/channel_points_custom_reward/remove.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ pub struct ChannelPointsCustomRewardRemoveV1Payload {
3131
pub background_color: String,
3232
/// The requested broadcaster ID.
3333
pub broadcaster_user_id: types::UserId,
34-
/// The requested broadcaster name.
34+
/// The requested broadcaster login.
35+
pub broadcaster_user_login: types::UserName,
36+
/// The requested broadcaster display name.
3537
pub broadcaster_user_name: types::UserName,
3638
/// Timestamp of the cooldown expiration. null if the reward isn’t on cooldown.
3739
pub cooldown_expires_at: Option<types::Timestamp>,
@@ -76,6 +78,7 @@ fn parse_payload() {
7678
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
7779
"type": "channel.channel_points_custom_reward.remove",
7880
"version": "1",
81+
"status": "enabled",
7982
"condition": {
8083
"broadcaster_user_id": "1337",
8184
"reward_id": "12345"
@@ -89,7 +92,8 @@ fn parse_payload() {
8992
"event": {
9093
"id": "9001",
9194
"broadcaster_user_id": "1337",
92-
"broadcaster_user_name": "cool_user",
95+
"broadcaster_user_login": "cool_user",
96+
"broadcaster_user_name": "Cool_User",
9397
"is_enabled": true,
9498
"is_paused": false,
9599
"is_in_stock": true,

src/eventsub/channel/channel_points_custom_reward/update.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ pub struct ChannelPointsCustomRewardUpdateV1Payload {
3131
pub background_color: String,
3232
/// The requested broadcaster ID.
3333
pub broadcaster_user_id: types::UserId,
34-
/// The requested broadcaster name.
35-
pub broadcaster_user_name: types::UserName,
34+
/// The requested broadcaster login.
35+
pub broadcaster_user_login: types::UserName,
36+
/// The requested broadcaster display name.
37+
pub broadcaster_user_name: types::DisplayName,
3638
/// Timestamp of the cooldown expiration. null if the reward isn’t on cooldown.
3739
pub cooldown_expires_at: Option<types::Timestamp>,
3840
/// The reward cost.
@@ -75,6 +77,7 @@ fn parse_payload() {
7577
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
7678
"type": "channel.channel_points_custom_reward.update",
7779
"version": "1",
80+
"status": "enabled",
7881
"condition": {
7982
"broadcaster_user_id": "1337"
8083
@@ -88,7 +91,8 @@ fn parse_payload() {
8891
"event": {
8992
"id": "9001",
9093
"broadcaster_user_id": "1337",
91-
"broadcaster_user_name": "cool_user",
94+
"broadcaster_user_login": "cool_user",
95+
"broadcaster_user_name": "Cool_User",
9296
"is_enabled": true,
9397
"is_paused": false,
9498
"is_in_stock": true,

src/eventsub/channel/channel_points_custom_reward_redemption/add.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ fn parse_payload() {
6060
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
6161
"type": "channel.channel_points_custom_reward_redemption.add",
6262
"version": "1",
63+
"status": "enabled",
6364
"condition": {
6465
"broadcaster_user_id": "1337"
6566
},

src/eventsub/channel/channel_points_custom_reward_redemption/update.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ fn parse_payload() {
5959
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
6060
"type": "channel.channel_points_custom_reward_redemption.update",
6161
"version": "1",
62+
"status": "enabled",
6263
"condition": {
6364
"broadcaster_user_id": "1337"
6465
},

src/eventsub/channel/cheer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ fn parse_payload() {
5353
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
5454
"type": "channel.cheer",
5555
"version": "1",
56+
"status": "enabled",
5657
"condition": {
5758
"broadcaster_user_id": "1337"
5859
},

src/eventsub/channel/follow.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ fn parse_payload() {
4747
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
4848
"type": "channel.follow",
4949
"version": "1",
50+
"status": "enabled",
5051
"condition": {
5152
"broadcaster_user_id": "1337"
5253
},

src/eventsub/channel/hypetrain/begin.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ fn parse_payload() {
5757
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
5858
"type": "channel.hype_train.begin",
5959
"version": "1",
60+
"status": "enabled",
6061
"condition": {
6162
"broadcaster_user_id": "1337"
6263
},

0 commit comments

Comments
 (0)