Skip to content

Commit fa1cd9a

Browse files
Merge #208
208: fix missing id on hypetrain eventsub r=Emilgardis a=Emilgardis Co-authored-by: Emil Gardström <[email protected]>
2 parents 8fd9309 + 0a8b44b commit fa1cd9a

File tree

6 files changed

+15
-1
lines changed

6 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
* Added function `get_follow_relationships`, `get_broadcaster_subscribers`, `get_global_emotes`, `get_channel_emotes_from_id`, `get_channel_emotes_from_login` and `get_emote_sets` to `HelixClient`
4040
* Added fields `format`, `scale`, `theme_mode` and `template` to `ChannelEmote`, `GetEmoteSets` and `GlobalEmote`
4141
* Added functions `HelixClient::req_<method>_custom` to return a specific struct/enum defined by the user. This also enables references in responses for these functions.
42+
* Added `HypeTrainId` to relevant eventsub and helix endpoints
4243

4344
### Changed
4445

src/eventsub/channel/hypetrain/begin.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ impl EventSubscription for ChannelHypeTrainBeginV1 {
2727
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
2828
#[non_exhaustive]
2929
pub struct ChannelHypeTrainBeginV1Payload {
30+
/// The Hype Train ID.
31+
pub id: types::HypeTrainId,
3032
/// The requested broadcaster ID.
3133
pub broadcaster_user_id: types::UserId,
3234
/// The requested broadcaster login.
@@ -71,6 +73,7 @@ fn parse_payload() {
7173
"created_at": "2019-11-16T10:11:12.123Z"
7274
},
7375
"event": {
76+
"id": "1b0AsbInCHZW2SQFQkCzqN07Ib2",
7477
"broadcaster_user_id": "1337",
7578
"broadcaster_user_login": "cool_user",
7679
"broadcaster_user_name": "Cool_User",

src/eventsub/channel/hypetrain/end.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ impl EventSubscription for ChannelHypeTrainEndV1 {
2727
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
2828
#[non_exhaustive]
2929
pub struct ChannelHypeTrainEndV1Payload {
30+
/// The Hype Train ID.
31+
pub id: types::HypeTrainId,
3032
/// The requested broadcaster ID.
3133
pub broadcaster_user_id: types::UserId,
3234
/// The requested broadcaster login.
@@ -68,6 +70,7 @@ fn parse_payload() {
6870
"created_at": "2019-11-16T10:11:12.123Z"
6971
},
7072
"event": {
73+
"id": "1b0AsbInCHZW2SQFQkCzqN07Ib2",
7174
"broadcaster_user_id": "1337",
7275
"broadcaster_user_login": "cool_user",
7376
"broadcaster_user_name": "Cool_User",

src/eventsub/channel/hypetrain/progress.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ impl EventSubscription for ChannelHypeTrainProgressV1 {
2727
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
2828
#[non_exhaustive]
2929
pub struct ChannelHypeTrainProgressV1Payload {
30+
/// The Hype Train ID.
31+
pub id: types::HypeTrainId,
3032
/// The requested broadcaster ID.
3133
pub broadcaster_user_id: types::UserId,
3234
/// The requested broadcaster login.
@@ -73,6 +75,7 @@ fn parse_payload() {
7375
"created_at": "2019-11-16T10:11:12.123Z"
7476
},
7577
"event": {
78+
"id": "1b0AsbInCHZW2SQFQkCzqN07Ib2",
7679
"broadcaster_user_id": "1337",
7780
"broadcaster_user_login": "cool_user",
7881
"broadcaster_user_name": "Cool_User",

src/helix/hypetrain/get_hypetrain_events.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ pub struct HypeTrainEventData {
113113
/// Total points contributed to the hype train.
114114
pub total: i64,
115115
/// The distinct ID of this Hype Train
116-
pub id: String,
116+
pub id: types::HypeTrainId,
117117
}
118118

119119
impl Request for GetHypeTrainEventsRequest {

src/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,10 @@ pub struct EmoteSetId;
666666
#[aliri_braid::braid(serde)]
667667
pub struct StreamSegmentId;
668668

669+
/// A Hype Train ID
670+
#[aliri_braid::braid(serde)]
671+
pub struct HypeTrainId;
672+
669673
/// An emote index as defined by eventsub, similar to IRC `emotes` twitch tag.
670674
#[derive(PartialEq, Eq, Deserialize, Serialize, Debug, Clone)]
671675
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]

0 commit comments

Comments
 (0)