From 60936d743e2498811f990b0aa95d3776e0426a5c Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Wed, 20 Nov 2024 21:57:30 +0100 Subject: [PATCH 1/4] docs(eventsub): mention subscription version --- src/eventsub/mod.rs | 160 ++++++++++++------------ xtask/src/collect_endpoints/eventsub.rs | 12 +- 2 files changed, 90 insertions(+), 82 deletions(-) diff --git a/src/eventsub/mod.rs b/src/eventsub/mod.rs index b4fede2472..a18026f885 100644 --- a/src/eventsub/mod.rs +++ b/src/eventsub/mod.rs @@ -83,12 +83,12 @@ //! //! | Name | Subscription
Payload | //! |---|:---| -//! | [`automod.message.hold`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#automodmessagehold) | [AutomodMessageHoldV1](automod::AutomodMessageHoldV1)
[AutomodMessageHoldV1Payload](automod::AutomodMessageHoldV1Payload) | -//! | [`automod.message.hold`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#automodmessagehold-v2) | [AutomodMessageHoldBeta](automod::AutomodMessageHoldBeta)
[AutomodMessageHoldBetaPayload](automod::AutomodMessageHoldBetaPayload) | -//! | [`automod.message.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#automodmessageupdate) | [AutomodMessageUpdateV1](automod::AutomodMessageUpdateV1)
[AutomodMessageUpdateV1Payload](automod::AutomodMessageUpdateV1Payload) | -//! | [`automod.message.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#automodmessageupdate-v2) | [AutomodMessageUpdateBeta](automod::AutomodMessageUpdateBeta)
[AutomodMessageUpdateBetaPayload](automod::AutomodMessageUpdateBetaPayload) | -//! | [`automod.settings.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#automodsettingsupdate) | [AutomodSettingsUpdateV1](automod::AutomodSettingsUpdateV1)
[AutomodSettingsUpdateV1Payload](automod::AutomodSettingsUpdateV1Payload) | -//! | [`automod.terms.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#automodtermsupdate) | [AutomodTermsUpdateV1](automod::AutomodTermsUpdateV1)
[AutomodTermsUpdateV1Payload](automod::AutomodTermsUpdateV1Payload) | +//! | [`automod.message.hold`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#automodmessagehold) (v1) | [AutomodMessageHoldV1](automod::AutomodMessageHoldV1)
[AutomodMessageHoldV1Payload](automod::AutomodMessageHoldV1Payload) | +//! | [`automod.message.hold`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#automodmessagehold-v2) (beta) | [AutomodMessageHoldBeta](automod::AutomodMessageHoldBeta)
[AutomodMessageHoldBetaPayload](automod::AutomodMessageHoldBetaPayload) | +//! | [`automod.message.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#automodmessageupdate) (v1) | [AutomodMessageUpdateV1](automod::AutomodMessageUpdateV1)
[AutomodMessageUpdateV1Payload](automod::AutomodMessageUpdateV1Payload) | +//! | [`automod.message.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#automodmessageupdate-v2) (beta) | [AutomodMessageUpdateBeta](automod::AutomodMessageUpdateBeta)
[AutomodMessageUpdateBetaPayload](automod::AutomodMessageUpdateBetaPayload) | +//! | [`automod.settings.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#automodsettingsupdate) (v1) | [AutomodSettingsUpdateV1](automod::AutomodSettingsUpdateV1)
[AutomodSettingsUpdateV1Payload](automod::AutomodSettingsUpdateV1Payload) | +//! | [`automod.terms.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#automodtermsupdate) (v1) | [AutomodTermsUpdateV1](automod::AutomodTermsUpdateV1)
[AutomodTermsUpdateV1Payload](automod::AutomodTermsUpdateV1Payload) | //! //! //! @@ -96,71 +96,71 @@ //! //! | Name | Subscription
Payload | //! |---|:---| -//! | [`channel.ad_break.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelad_breakbegin) | [ChannelAdBreakBeginV1](channel::ChannelAdBreakBeginV1)
[ChannelAdBreakBeginV1Payload](channel::ChannelAdBreakBeginV1Payload) | -//! | [`channel.ban`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelban) | [ChannelBanV1](channel::ChannelBanV1)
[ChannelBanV1Payload](channel::ChannelBanV1Payload) | -//! | [`channel.channel_points_automatic_reward_redemption.add`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchannel_points_automatic_reward_redemptionadd) | -
- | -//! | [`channel.channel_points_custom_reward.add`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchannel_points_custom_rewardadd) | [ChannelPointsCustomRewardAddV1](channel::ChannelPointsCustomRewardAddV1)
[ChannelPointsCustomRewardAddV1Payload](channel::ChannelPointsCustomRewardAddV1Payload) | -//! | [`channel.channel_points_custom_reward.remove`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchannel_points_custom_rewardremove) | [ChannelPointsCustomRewardRemoveV1](channel::ChannelPointsCustomRewardRemoveV1)
[ChannelPointsCustomRewardRemoveV1Payload](channel::ChannelPointsCustomRewardRemoveV1Payload) | -//! | [`channel.channel_points_custom_reward.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchannel_points_custom_rewardupdate) | [ChannelPointsCustomRewardUpdateV1](channel::ChannelPointsCustomRewardUpdateV1)
[ChannelPointsCustomRewardUpdateV1Payload](channel::ChannelPointsCustomRewardUpdateV1Payload) | -//! | [`channel.channel_points_custom_reward_redemption.add`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchannel_points_custom_reward_redemptionadd) | [ChannelPointsCustomRewardRedemptionAddV1](channel::ChannelPointsCustomRewardRedemptionAddV1)
[ChannelPointsCustomRewardRedemptionAddV1Payload](channel::ChannelPointsCustomRewardRedemptionAddV1Payload) | -//! | [`channel.channel_points_custom_reward_redemption.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchannel_points_custom_reward_redemptionupdate) | [ChannelPointsCustomRewardRedemptionUpdateV1](channel::ChannelPointsCustomRewardRedemptionUpdateV1)
[ChannelPointsCustomRewardRedemptionUpdateV1Payload](channel::ChannelPointsCustomRewardRedemptionUpdateV1Payload) | -//! | [`channel.charity_campaign.donate`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelcharity_campaigndonate) | [ChannelCharityCampaignDonateV1](channel::ChannelCharityCampaignDonateV1)
[ChannelCharityCampaignDonateV1Payload](channel::ChannelCharityCampaignDonateV1Payload) | -//! | [`channel.charity_campaign.progress`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelcharity_campaignprogress) | [ChannelCharityCampaignProgressV1](channel::ChannelCharityCampaignProgressV1)
[ChannelCharityCampaignProgressV1Payload](channel::ChannelCharityCampaignProgressV1Payload) | -//! | [`channel.charity_campaign.start`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelcharity_campaignstart) | [ChannelCharityCampaignStartV1](channel::ChannelCharityCampaignStartV1)
[ChannelCharityCampaignStartV1Payload](channel::ChannelCharityCampaignStartV1Payload) | -//! | [`channel.charity_campaign.stop`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelcharity_campaignstop) | [ChannelCharityCampaignStopV1](channel::ChannelCharityCampaignStopV1)
[ChannelCharityCampaignStopV1Payload](channel::ChannelCharityCampaignStopV1Payload) | -//! | [`channel.chat.clear`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchatclear) | [ChannelChatClearV1](channel::ChannelChatClearV1)
[ChannelChatClearV1Payload](channel::ChannelChatClearV1Payload) | -//! | [`channel.chat.clear_user_messages`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchatclear_user_messages) | [ChannelChatClearUserMessagesV1](channel::ChannelChatClearUserMessagesV1)
[ChannelChatClearUserMessagesV1Payload](channel::ChannelChatClearUserMessagesV1Payload) | -//! | [`channel.chat.message`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchatmessage) | [ChannelChatMessageV1](channel::ChannelChatMessageV1)
[ChannelChatMessageV1Payload](channel::ChannelChatMessageV1Payload) | -//! | [`channel.chat.message_delete`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchatmessage_delete) | [ChannelChatMessageDeleteV1](channel::ChannelChatMessageDeleteV1)
[ChannelChatMessageDeleteV1Payload](channel::ChannelChatMessageDeleteV1Payload) | -//! | [`channel.chat.notification`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchatnotification) | [ChannelChatNotificationV1](channel::ChannelChatNotificationV1)
[ChannelChatNotificationV1Payload](channel::ChannelChatNotificationV1Payload) | -//! | [`channel.chat.user_message_hold`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchatuser_message_hold) | [ChannelChatUserMessageHoldV1](channel::ChannelChatUserMessageHoldV1)
[ChannelChatUserMessageHoldV1Payload](channel::ChannelChatUserMessageHoldV1Payload) | -//! | [`channel.chat.user_message_update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchatuser_message_update) | [ChannelChatUserMessageUpdateV1](channel::ChannelChatUserMessageUpdateV1)
[ChannelChatUserMessageUpdateV1Payload](channel::ChannelChatUserMessageUpdateV1Payload) | -//! | [`channel.chat_settings.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchat_settingsupdate) | -
- | -//! | [`channel.cheer`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelcheer) | [ChannelCheerV1](channel::ChannelCheerV1)
[ChannelCheerV1Payload](channel::ChannelCheerV1Payload) | -//! | [`channel.follow`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelfollow) | [ChannelFollowV2](channel::ChannelFollowV2)
[ChannelFollowV2Payload](channel::ChannelFollowV2Payload) | -//! | [`channel.goal.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelgoalbegin) | [ChannelGoalBeginV1](channel::ChannelGoalBeginV1)
[ChannelGoalBeginV1Payload](channel::ChannelGoalBeginV1Payload) | -//! | [`channel.goal.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelgoalend) | [ChannelGoalEndV1](channel::ChannelGoalEndV1)
[ChannelGoalEndV1Payload](channel::ChannelGoalEndV1Payload) | -//! | [`channel.goal.progress`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelgoalprogress) | [ChannelGoalProgressV1](channel::ChannelGoalProgressV1)
[ChannelGoalProgressV1Payload](channel::ChannelGoalProgressV1Payload) | -//! | [`channel.guest_star_guest.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelguest_star_guestupdate) | -
- | -//! | [`channel.guest_star_session.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelguest_star_sessionbegin) | -
- | -//! | [`channel.guest_star_session.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelguest_star_sessionend) | -
- | -//! | [`channel.guest_star_settings.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelguest_star_settingsupdate) | -
- | -//! | [`channel.hype_train.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelhype_trainbegin) | [ChannelHypeTrainBeginV1](channel::ChannelHypeTrainBeginV1)
[ChannelHypeTrainBeginV1Payload](channel::ChannelHypeTrainBeginV1Payload) | -//! | [`channel.hype_train.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelhype_trainend) | [ChannelHypeTrainEndV1](channel::ChannelHypeTrainEndV1)
[ChannelHypeTrainEndV1Payload](channel::ChannelHypeTrainEndV1Payload) | -//! | [`channel.hype_train.progress`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelhype_trainprogress) | [ChannelHypeTrainProgressV1](channel::ChannelHypeTrainProgressV1)
[ChannelHypeTrainProgressV1Payload](channel::ChannelHypeTrainProgressV1Payload) | -//! | [`channel.moderate`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelmoderate) | -
- | -//! | [`channel.moderate`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelmoderate-v2) | -
- | -//! | [`channel.moderator.add`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelmoderatoradd) | -
- | -//! | [`channel.moderator.remove`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelmoderatorremove) | -
- | -//! | [`channel.poll.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelpollbegin) | [ChannelPollBeginV1](channel::ChannelPollBeginV1)
[ChannelPollBeginV1Payload](channel::ChannelPollBeginV1Payload) | -//! | [`channel.poll.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelpollend) | [ChannelPollEndV1](channel::ChannelPollEndV1)
[ChannelPollEndV1Payload](channel::ChannelPollEndV1Payload) | -//! | [`channel.poll.progress`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelpollprogress) | [ChannelPollProgressV1](channel::ChannelPollProgressV1)
[ChannelPollProgressV1Payload](channel::ChannelPollProgressV1Payload) | -//! | [`channel.prediction.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelpredictionbegin) | [ChannelPredictionBeginV1](channel::ChannelPredictionBeginV1)
[ChannelPredictionBeginV1Payload](channel::ChannelPredictionBeginV1Payload) | -//! | [`channel.prediction.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelpredictionend) | [ChannelPredictionEndV1](channel::ChannelPredictionEndV1)
[ChannelPredictionEndV1Payload](channel::ChannelPredictionEndV1Payload) | -//! | [`channel.prediction.lock`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelpredictionlock) | [ChannelPredictionLockV1](channel::ChannelPredictionLockV1)
[ChannelPredictionLockV1Payload](channel::ChannelPredictionLockV1Payload) | -//! | [`channel.prediction.progress`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelpredictionprogress) | [ChannelPredictionProgressV1](channel::ChannelPredictionProgressV1)
[ChannelPredictionProgressV1Payload](channel::ChannelPredictionProgressV1Payload) | -//! | [`channel.raid`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelraid) | [ChannelRaidV1](channel::ChannelRaidV1)
[ChannelRaidV1Payload](channel::ChannelRaidV1Payload) | -//! | [`channel.shared_chat.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshared_chatbegin) | [ChannelSharedChatBeginV1](channel::ChannelSharedChatBeginV1)
[ChannelSharedChatBeginV1Payload](channel::ChannelSharedChatBeginV1Payload) | -//! | [`channel.shared_chat.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshared_chatend) | [ChannelSharedChatEndV1](channel::ChannelSharedChatEndV1)
[ChannelSharedChatEndV1Payload](channel::ChannelSharedChatEndV1Payload) | -//! | [`channel.shared_chat.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshared_chatupdate) | [ChannelSharedChatUpdateV1](channel::ChannelSharedChatUpdateV1)
[ChannelSharedChatUpdateV1Payload](channel::ChannelSharedChatUpdateV1Payload) | -//! | [`channel.shield_mode.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshield_modebegin) | [ChannelShieldModeBeginV1](channel::ChannelShieldModeBeginV1)
[ChannelShieldModeBeginV1Payload](channel::ChannelShieldModeBeginV1Payload) | -//! | [`channel.shield_mode.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshield_modeend) | [ChannelShieldModeEndV1](channel::ChannelShieldModeEndV1)
[ChannelShieldModeEndV1Payload](channel::ChannelShieldModeEndV1Payload) | -//! | [`channel.shoutout.create`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshoutoutcreate) | [ChannelShoutoutCreateV1](channel::ChannelShoutoutCreateV1)
[ChannelShoutoutCreateV1Payload](channel::ChannelShoutoutCreateV1Payload) | -//! | [`channel.shoutout.receive`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshoutoutreceive) | [ChannelShoutoutReceiveV1](channel::ChannelShoutoutReceiveV1)
[ChannelShoutoutReceiveV1Payload](channel::ChannelShoutoutReceiveV1Payload) | -//! | [`channel.subscribe`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelsubscribe) | [ChannelSubscribeV1](channel::ChannelSubscribeV1)
[ChannelSubscribeV1Payload](channel::ChannelSubscribeV1Payload) | -//! | [`channel.subscription.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelsubscriptionend) | [ChannelSubscriptionEndV1](channel::ChannelSubscriptionEndV1)
[ChannelSubscriptionEndV1Payload](channel::ChannelSubscriptionEndV1Payload) | -//! | [`channel.subscription.gift`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelsubscriptiongift) | [ChannelSubscriptionGiftV1](channel::ChannelSubscriptionGiftV1)
[ChannelSubscriptionGiftV1Payload](channel::ChannelSubscriptionGiftV1Payload) | -//! | [`channel.subscription.message`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelsubscriptionmessage) | [ChannelSubscriptionMessageV1](channel::ChannelSubscriptionMessageV1)
[ChannelSubscriptionMessageV1Payload](channel::ChannelSubscriptionMessageV1Payload) | -//! | [`channel.suspicious_user.message`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelsuspicious_usermessage) | -
- | -//! | [`channel.suspicious_user.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelsuspicious_userupdate) | -
- | -//! | [`channel.unban`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelunban) | [ChannelUnbanV1](channel::ChannelUnbanV1)
[ChannelUnbanV1Payload](channel::ChannelUnbanV1Payload) | -//! | [`channel.unban_request.create`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelunban_requestcreate) | -
- | -//! | [`channel.unban_request.resolve`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelunban_requestresolve) | -
- | -//! | [`channel.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelupdate) | [ChannelUpdateV2](channel::ChannelUpdateV2)
[ChannelUpdateV2Payload](channel::ChannelUpdateV2Payload) | -//! | [`channel.vip.add`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelvipadd) | -
- | -//! | [`channel.vip.remove`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelvipremove) | -
- | -//! | [`channel.warning.acknowledge`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelwarningacknowledge) | -
- | -//! | [`channel.warning.send`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelwarningsend) | -
- | +//! | [`channel.ad_break.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelad_breakbegin) (v1) | [ChannelAdBreakBeginV1](channel::ChannelAdBreakBeginV1)
[ChannelAdBreakBeginV1Payload](channel::ChannelAdBreakBeginV1Payload) | +//! | [`channel.ban`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelban) (v1) | [ChannelBanV1](channel::ChannelBanV1)
[ChannelBanV1Payload](channel::ChannelBanV1Payload) | +//! | [`channel.channel_points_automatic_reward_redemption.add`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchannel_points_automatic_reward_redemptionadd) (v1) | -
- | +//! | [`channel.channel_points_custom_reward.add`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchannel_points_custom_rewardadd) (v1) | [ChannelPointsCustomRewardAddV1](channel::ChannelPointsCustomRewardAddV1)
[ChannelPointsCustomRewardAddV1Payload](channel::ChannelPointsCustomRewardAddV1Payload) | +//! | [`channel.channel_points_custom_reward.remove`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchannel_points_custom_rewardremove) (v1) | [ChannelPointsCustomRewardRemoveV1](channel::ChannelPointsCustomRewardRemoveV1)
[ChannelPointsCustomRewardRemoveV1Payload](channel::ChannelPointsCustomRewardRemoveV1Payload) | +//! | [`channel.channel_points_custom_reward.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchannel_points_custom_rewardupdate) (v1) | [ChannelPointsCustomRewardUpdateV1](channel::ChannelPointsCustomRewardUpdateV1)
[ChannelPointsCustomRewardUpdateV1Payload](channel::ChannelPointsCustomRewardUpdateV1Payload) | +//! | [`channel.channel_points_custom_reward_redemption.add`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchannel_points_custom_reward_redemptionadd) (v1) | [ChannelPointsCustomRewardRedemptionAddV1](channel::ChannelPointsCustomRewardRedemptionAddV1)
[ChannelPointsCustomRewardRedemptionAddV1Payload](channel::ChannelPointsCustomRewardRedemptionAddV1Payload) | +//! | [`channel.channel_points_custom_reward_redemption.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchannel_points_custom_reward_redemptionupdate) (v1) | [ChannelPointsCustomRewardRedemptionUpdateV1](channel::ChannelPointsCustomRewardRedemptionUpdateV1)
[ChannelPointsCustomRewardRedemptionUpdateV1Payload](channel::ChannelPointsCustomRewardRedemptionUpdateV1Payload) | +//! | [`channel.charity_campaign.donate`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelcharity_campaigndonate) (v1) | [ChannelCharityCampaignDonateV1](channel::ChannelCharityCampaignDonateV1)
[ChannelCharityCampaignDonateV1Payload](channel::ChannelCharityCampaignDonateV1Payload) | +//! | [`channel.charity_campaign.progress`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelcharity_campaignprogress) (v1) | [ChannelCharityCampaignProgressV1](channel::ChannelCharityCampaignProgressV1)
[ChannelCharityCampaignProgressV1Payload](channel::ChannelCharityCampaignProgressV1Payload) | +//! | [`channel.charity_campaign.start`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelcharity_campaignstart) (v1) | [ChannelCharityCampaignStartV1](channel::ChannelCharityCampaignStartV1)
[ChannelCharityCampaignStartV1Payload](channel::ChannelCharityCampaignStartV1Payload) | +//! | [`channel.charity_campaign.stop`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelcharity_campaignstop) (v1) | [ChannelCharityCampaignStopV1](channel::ChannelCharityCampaignStopV1)
[ChannelCharityCampaignStopV1Payload](channel::ChannelCharityCampaignStopV1Payload) | +//! | [`channel.chat.clear`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchatclear) (v1) | [ChannelChatClearV1](channel::ChannelChatClearV1)
[ChannelChatClearV1Payload](channel::ChannelChatClearV1Payload) | +//! | [`channel.chat.clear_user_messages`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchatclear_user_messages) (v1) | [ChannelChatClearUserMessagesV1](channel::ChannelChatClearUserMessagesV1)
[ChannelChatClearUserMessagesV1Payload](channel::ChannelChatClearUserMessagesV1Payload) | +//! | [`channel.chat.message`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchatmessage) (v1) | [ChannelChatMessageV1](channel::ChannelChatMessageV1)
[ChannelChatMessageV1Payload](channel::ChannelChatMessageV1Payload) | +//! | [`channel.chat.message_delete`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchatmessage_delete) (v1) | [ChannelChatMessageDeleteV1](channel::ChannelChatMessageDeleteV1)
[ChannelChatMessageDeleteV1Payload](channel::ChannelChatMessageDeleteV1Payload) | +//! | [`channel.chat.notification`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchatnotification) (v1) | [ChannelChatNotificationV1](channel::ChannelChatNotificationV1)
[ChannelChatNotificationV1Payload](channel::ChannelChatNotificationV1Payload) | +//! | [`channel.chat.user_message_hold`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchatuser_message_hold) (v1) | [ChannelChatUserMessageHoldV1](channel::ChannelChatUserMessageHoldV1)
[ChannelChatUserMessageHoldV1Payload](channel::ChannelChatUserMessageHoldV1Payload) | +//! | [`channel.chat.user_message_update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchatuser_message_update) (v1) | [ChannelChatUserMessageUpdateV1](channel::ChannelChatUserMessageUpdateV1)
[ChannelChatUserMessageUpdateV1Payload](channel::ChannelChatUserMessageUpdateV1Payload) | +//! | [`channel.chat_settings.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelchat_settingsupdate) (v1) | -
- | +//! | [`channel.cheer`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelcheer) (v1) | [ChannelCheerV1](channel::ChannelCheerV1)
[ChannelCheerV1Payload](channel::ChannelCheerV1Payload) | +//! | [`channel.follow`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelfollow) (v2) | [ChannelFollowV2](channel::ChannelFollowV2)
[ChannelFollowV2Payload](channel::ChannelFollowV2Payload) | +//! | [`channel.goal.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelgoalbegin) (v1) | [ChannelGoalBeginV1](channel::ChannelGoalBeginV1)
[ChannelGoalBeginV1Payload](channel::ChannelGoalBeginV1Payload) | +//! | [`channel.goal.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelgoalend) (v1) | [ChannelGoalEndV1](channel::ChannelGoalEndV1)
[ChannelGoalEndV1Payload](channel::ChannelGoalEndV1Payload) | +//! | [`channel.goal.progress`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelgoalprogress) (v1) | [ChannelGoalProgressV1](channel::ChannelGoalProgressV1)
[ChannelGoalProgressV1Payload](channel::ChannelGoalProgressV1Payload) | +//! | [`channel.guest_star_guest.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelguest_star_guestupdate) (beta) | -
- | +//! | [`channel.guest_star_session.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelguest_star_sessionbegin) (beta) | -
- | +//! | [`channel.guest_star_session.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelguest_star_sessionend) (beta) | -
- | +//! | [`channel.guest_star_settings.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelguest_star_settingsupdate) (beta) | -
- | +//! | [`channel.hype_train.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelhype_trainbegin) (v1) | [ChannelHypeTrainBeginV1](channel::ChannelHypeTrainBeginV1)
[ChannelHypeTrainBeginV1Payload](channel::ChannelHypeTrainBeginV1Payload) | +//! | [`channel.hype_train.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelhype_trainend) (v1) | [ChannelHypeTrainEndV1](channel::ChannelHypeTrainEndV1)
[ChannelHypeTrainEndV1Payload](channel::ChannelHypeTrainEndV1Payload) | +//! | [`channel.hype_train.progress`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelhype_trainprogress) (v1) | [ChannelHypeTrainProgressV1](channel::ChannelHypeTrainProgressV1)
[ChannelHypeTrainProgressV1Payload](channel::ChannelHypeTrainProgressV1Payload) | +//! | [`channel.moderate`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelmoderate) (v1) | -
- | +//! | [`channel.moderate`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelmoderate-v2) (v2) | -
- | +//! | [`channel.moderator.add`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelmoderatoradd) (v1) | -
- | +//! | [`channel.moderator.remove`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelmoderatorremove) (v1) | -
- | +//! | [`channel.poll.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelpollbegin) (v1) | [ChannelPollBeginV1](channel::ChannelPollBeginV1)
[ChannelPollBeginV1Payload](channel::ChannelPollBeginV1Payload) | +//! | [`channel.poll.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelpollend) (v1) | [ChannelPollEndV1](channel::ChannelPollEndV1)
[ChannelPollEndV1Payload](channel::ChannelPollEndV1Payload) | +//! | [`channel.poll.progress`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelpollprogress) (v1) | [ChannelPollProgressV1](channel::ChannelPollProgressV1)
[ChannelPollProgressV1Payload](channel::ChannelPollProgressV1Payload) | +//! | [`channel.prediction.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelpredictionbegin) (v1) | [ChannelPredictionBeginV1](channel::ChannelPredictionBeginV1)
[ChannelPredictionBeginV1Payload](channel::ChannelPredictionBeginV1Payload) | +//! | [`channel.prediction.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelpredictionend) (v1) | [ChannelPredictionEndV1](channel::ChannelPredictionEndV1)
[ChannelPredictionEndV1Payload](channel::ChannelPredictionEndV1Payload) | +//! | [`channel.prediction.lock`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelpredictionlock) (v1) | [ChannelPredictionLockV1](channel::ChannelPredictionLockV1)
[ChannelPredictionLockV1Payload](channel::ChannelPredictionLockV1Payload) | +//! | [`channel.prediction.progress`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelpredictionprogress) (v1) | [ChannelPredictionProgressV1](channel::ChannelPredictionProgressV1)
[ChannelPredictionProgressV1Payload](channel::ChannelPredictionProgressV1Payload) | +//! | [`channel.raid`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelraid) (v1) | [ChannelRaidV1](channel::ChannelRaidV1)
[ChannelRaidV1Payload](channel::ChannelRaidV1Payload) | +//! | [`channel.shared_chat.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshared_chatbegin) (v1) | [ChannelSharedChatBeginV1](channel::ChannelSharedChatBeginV1)
[ChannelSharedChatBeginV1Payload](channel::ChannelSharedChatBeginV1Payload) | +//! | [`channel.shared_chat.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshared_chatend) (v1) | [ChannelSharedChatEndV1](channel::ChannelSharedChatEndV1)
[ChannelSharedChatEndV1Payload](channel::ChannelSharedChatEndV1Payload) | +//! | [`channel.shared_chat.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshared_chatupdate) (v1) | [ChannelSharedChatUpdateV1](channel::ChannelSharedChatUpdateV1)
[ChannelSharedChatUpdateV1Payload](channel::ChannelSharedChatUpdateV1Payload) | +//! | [`channel.shield_mode.begin`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshield_modebegin) (v1) | [ChannelShieldModeBeginV1](channel::ChannelShieldModeBeginV1)
[ChannelShieldModeBeginV1Payload](channel::ChannelShieldModeBeginV1Payload) | +//! | [`channel.shield_mode.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshield_modeend) (v1) | [ChannelShieldModeEndV1](channel::ChannelShieldModeEndV1)
[ChannelShieldModeEndV1Payload](channel::ChannelShieldModeEndV1Payload) | +//! | [`channel.shoutout.create`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshoutoutcreate) (v1) | [ChannelShoutoutCreateV1](channel::ChannelShoutoutCreateV1)
[ChannelShoutoutCreateV1Payload](channel::ChannelShoutoutCreateV1Payload) | +//! | [`channel.shoutout.receive`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshoutoutreceive) (v1) | [ChannelShoutoutReceiveV1](channel::ChannelShoutoutReceiveV1)
[ChannelShoutoutReceiveV1Payload](channel::ChannelShoutoutReceiveV1Payload) | +//! | [`channel.subscribe`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelsubscribe) (v1) | [ChannelSubscribeV1](channel::ChannelSubscribeV1)
[ChannelSubscribeV1Payload](channel::ChannelSubscribeV1Payload) | +//! | [`channel.subscription.end`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelsubscriptionend) (v1) | [ChannelSubscriptionEndV1](channel::ChannelSubscriptionEndV1)
[ChannelSubscriptionEndV1Payload](channel::ChannelSubscriptionEndV1Payload) | +//! | [`channel.subscription.gift`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelsubscriptiongift) (v1) | [ChannelSubscriptionGiftV1](channel::ChannelSubscriptionGiftV1)
[ChannelSubscriptionGiftV1Payload](channel::ChannelSubscriptionGiftV1Payload) | +//! | [`channel.subscription.message`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelsubscriptionmessage) (v1) | [ChannelSubscriptionMessageV1](channel::ChannelSubscriptionMessageV1)
[ChannelSubscriptionMessageV1Payload](channel::ChannelSubscriptionMessageV1Payload) | +//! | [`channel.suspicious_user.message`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelsuspicious_usermessage) (v1) | -
- | +//! | [`channel.suspicious_user.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelsuspicious_userupdate) (v1) | -
- | +//! | [`channel.unban`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelunban) (v1) | [ChannelUnbanV1](channel::ChannelUnbanV1)
[ChannelUnbanV1Payload](channel::ChannelUnbanV1Payload) | +//! | [`channel.unban_request.create`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelunban_requestcreate) (v1) | -
- | +//! | [`channel.unban_request.resolve`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelunban_requestresolve) (v1) | -
- | +//! | [`channel.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelupdate) (v2) | [ChannelUpdateV2](channel::ChannelUpdateV2)
[ChannelUpdateV2Payload](channel::ChannelUpdateV2Payload) | +//! | [`channel.vip.add`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelvipadd) (v1) | -
- | +//! | [`channel.vip.remove`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelvipremove) (v1) | -
- | +//! | [`channel.warning.acknowledge`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelwarningacknowledge) (v1) | -
- | +//! | [`channel.warning.send`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelwarningsend) (v1) | -
- | //! //! //! @@ -168,7 +168,7 @@ //! //! | Name | Subscription
Payload | //! |---|:---| -//! | [`conduit.shard.disabled`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#conduitsharddisabled) | [ConduitShardDisabledV1](conduit::ConduitShardDisabledV1)
[ConduitShardDisabledV1Payload](conduit::ConduitShardDisabledV1Payload) | +//! | [`conduit.shard.disabled`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#conduitsharddisabled) (v1) | [ConduitShardDisabledV1](conduit::ConduitShardDisabledV1)
[ConduitShardDisabledV1Payload](conduit::ConduitShardDisabledV1Payload) | //! //! //! @@ -176,7 +176,7 @@ //! //! | Name | Subscription
Payload | //! |---|:---| -//! | [`drop.entitlement.grant`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#dropentitlementgrant) | -
- | +//! | [`drop.entitlement.grant`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#dropentitlementgrant) (v1) | -
- | //! //! //! @@ -184,7 +184,7 @@ //! //! | Name | Subscription
Payload | //! |---|:---| -//! | [`extension.bits_transaction.create`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#extensionbits_transactioncreate) | -
- | +//! | [`extension.bits_transaction.create`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#extensionbits_transactioncreate) (v1) | -
- | //! //! //! @@ -192,8 +192,8 @@ //! //! | Name | Subscription
Payload | //! |---|:---| -//! | [`stream.offline`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#streamoffline) | [StreamOfflineV1](stream::StreamOfflineV1)
[StreamOfflineV1Payload](stream::StreamOfflineV1Payload) | -//! | [`stream.online`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#streamonline) | [StreamOnlineV1](stream::StreamOnlineV1)
[StreamOnlineV1Payload](stream::StreamOnlineV1Payload) | +//! | [`stream.offline`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#streamoffline) (v1) | [StreamOfflineV1](stream::StreamOfflineV1)
[StreamOfflineV1Payload](stream::StreamOfflineV1Payload) | +//! | [`stream.online`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#streamonline) (v1) | [StreamOnlineV1](stream::StreamOnlineV1)
[StreamOnlineV1Payload](stream::StreamOnlineV1Payload) | //! //! //! @@ -201,10 +201,10 @@ //! //! | Name | Subscription
Payload | //! |---|:---| -//! | [`user.authorization.grant`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#userauthorizationgrant) | [UserAuthorizationGrantV1](user::UserAuthorizationGrantV1)
[UserAuthorizationGrantV1Payload](user::UserAuthorizationGrantV1Payload) | -//! | [`user.authorization.revoke`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#userauthorizationrevoke) | [UserAuthorizationRevokeV1](user::UserAuthorizationRevokeV1)
[UserAuthorizationRevokeV1Payload](user::UserAuthorizationRevokeV1Payload) | -//! | [`user.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#userupdate) | [UserUpdateV1](user::UserUpdateV1)
[UserUpdateV1Payload](user::UserUpdateV1Payload) | -//! | [`user.whisper.message`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#userwhispermessage) | -
- | +//! | [`user.authorization.grant`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#userauthorizationgrant) (v1) | [UserAuthorizationGrantV1](user::UserAuthorizationGrantV1)
[UserAuthorizationGrantV1Payload](user::UserAuthorizationGrantV1Payload) | +//! | [`user.authorization.revoke`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#userauthorizationrevoke) (v1) | [UserAuthorizationRevokeV1](user::UserAuthorizationRevokeV1)
[UserAuthorizationRevokeV1Payload](user::UserAuthorizationRevokeV1Payload) | +//! | [`user.update`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#userupdate) (v1) | [UserUpdateV1](user::UserUpdateV1)
[UserUpdateV1Payload](user::UserUpdateV1Payload) | +//! | [`user.whisper.message`](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#userwhispermessage) (v1) | -
- | //! //! //! diff --git a/xtask/src/collect_endpoints/eventsub.rs b/xtask/src/collect_endpoints/eventsub.rs index 4c0fd0408d..c644dd4474 100644 --- a/xtask/src/collect_endpoints/eventsub.rs +++ b/xtask/src/collect_endpoints/eventsub.rs @@ -58,7 +58,13 @@ pub fn make_overview(base_url: &Url, raw: &str, rustdoc: &ParsedEventsubRustdoc) format!("`{n}`") } }; - let name = format!("[{}]({})", fmt_name(&sub.name), sub.link); + let version = if sub.is_numeric_version() { + format!("v{}", sub.version) + } else { + sub.version.to_string() + }; + + let name = format!("[{}]({}) ({version})", fmt_name(&sub.name), sub.link); if is_implemented(&sub_name, &payload_name) { EventSubEntry { name, @@ -179,7 +185,7 @@ impl<'a> EventSubRow<'a> { append_pascal(&mut buf, part); } - if self.version.chars().all(|it| it.is_numeric()) { + if self.is_numeric_version() { buf.push('V'); buf.push_str(&self.version); } else { @@ -188,4 +194,6 @@ impl<'a> EventSubRow<'a> { buf } + + pub fn is_numeric_version(&self) -> bool { self.version.chars().all(|it| it.is_numeric()) } } From 0bbbbf737c4deaf0cd7d8d251c843b5aef0461b3 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Wed, 20 Nov 2024 22:02:07 +0100 Subject: [PATCH 2/4] fix: use correct types for display-name/login --- .../channel/channel_points_custom_reward/remove.rs | 2 +- src/eventsub/channel/chat/message.rs | 8 ++++---- src/eventsub/channel/subscription/end.rs | 8 ++++---- src/eventsub/channel/subscription/gift.rs | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/eventsub/channel/channel_points_custom_reward/remove.rs b/src/eventsub/channel/channel_points_custom_reward/remove.rs index c5c557c52a..d8b323072e 100644 --- a/src/eventsub/channel/channel_points_custom_reward/remove.rs +++ b/src/eventsub/channel/channel_points_custom_reward/remove.rs @@ -56,7 +56,7 @@ pub struct ChannelPointsCustomRewardRemoveV1Payload { /// The requested broadcaster login. pub broadcaster_user_login: types::UserName, /// The requested broadcaster display name. - pub broadcaster_user_name: types::UserName, + pub broadcaster_user_name: types::DisplayName, /// Timestamp of the cooldown expiration. null if the reward isn’t on cooldown. pub cooldown_expires_at: Option, /// The reward cost. diff --git a/src/eventsub/channel/chat/message.rs b/src/eventsub/channel/chat/message.rs index 97d1a86219..38b03754ed 100644 --- a/src/eventsub/channel/chat/message.rs +++ b/src/eventsub/channel/chat/message.rs @@ -51,13 +51,13 @@ pub struct ChannelChatMessageV1Payload { /// The broadcaster user ID. pub broadcaster_user_id: types::UserId, /// The broadcaster display name. - pub broadcaster_user_name: types::UserName, + pub broadcaster_user_name: types::DisplayName, /// The broadcaster login. pub broadcaster_user_login: types::UserName, /// The user ID of the user that sent the message. pub chatter_user_id: types::UserId, /// The user name of the user that sent the message. - pub chatter_user_name: types::UserName, + pub chatter_user_name: types::DisplayName, /// The user login of the user that sent the message. pub chatter_user_login: types::UserName, /// A UUID that identifies the message. @@ -137,7 +137,7 @@ pub struct Reply { /// User ID of the sender of the parent message. pub parent_user_id: types::UserId, /// User name of the sender of the parent message. - pub parent_user_name: types::UserName, + pub parent_user_name: types::DisplayName, /// User login of the sender of the parent message. pub parent_user_login: types::UserName, /// An ID that identifies the parent message of the reply thread. @@ -145,7 +145,7 @@ pub struct Reply { /// User ID of the sender of the thread's parent message. pub thread_user_id: types::UserId, /// User name of the sender of the thread's parent message. - pub thread_user_name: types::UserName, + pub thread_user_name: types::DisplayName, /// User login of the sender of the thread's parent message. pub thread_user_login: types::UserName, } diff --git a/src/eventsub/channel/subscription/end.rs b/src/eventsub/channel/subscription/end.rs index 16527a0aac..5be8a8d92f 100644 --- a/src/eventsub/channel/subscription/end.rs +++ b/src/eventsub/channel/subscription/end.rs @@ -40,15 +40,15 @@ pub struct ChannelSubscriptionEndV1Payload { /// The broadcaster user ID. pub broadcaster_user_id: types::UserId, /// The broadcaster login. - pub broadcaster_user_login: types::DisplayName, + pub broadcaster_user_login: types::UserName, /// The broadcaster display name. - pub broadcaster_user_name: types::UserName, + pub broadcaster_user_name: types::DisplayName, /// The user ID for the user whose subscription ended. pub user_id: types::UserId, /// The user login for the user whose subscription ended. - pub user_login: types::DisplayName, + pub user_login: types::UserName, /// The user display name for the user whose subscription ended. - pub user_name: types::UserName, + pub user_name: types::DisplayName, /// The tier of the subscription that ended. Valid values are 1000, 2000, and 3000. pub tier: types::SubscriptionTier, /// Whether the subscription was a gift. diff --git a/src/eventsub/channel/subscription/gift.rs b/src/eventsub/channel/subscription/gift.rs index 8ec379ef2f..31cb1396fe 100644 --- a/src/eventsub/channel/subscription/gift.rs +++ b/src/eventsub/channel/subscription/gift.rs @@ -40,9 +40,9 @@ pub struct ChannelSubscriptionGiftV1Payload { /// The broadcaster user ID. pub broadcaster_user_id: types::UserId, /// The broadcaster login. - pub broadcaster_user_login: types::DisplayName, + pub broadcaster_user_login: types::UserName, /// The broadcaster display name. - pub broadcaster_user_name: types::UserName, + pub broadcaster_user_name: types::DisplayName, /// 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. pub cumulative_total: Option, /// Whether the subscription gift was anonymous. @@ -54,9 +54,9 @@ pub struct ChannelSubscriptionGiftV1Payload { /// The user ID of the user who sent the subscription gift. Set to null if it was an anonymous subscription gift. pub user_id: Option, /// The user login of the user who sent the gift. Set to null if it was an anonymous subscription gift. - pub user_login: Option, + pub user_login: Option, /// The user display name of the user who sent the gift. Set to null if it was an anonymous subscription gift. - pub user_name: Option, + pub user_name: Option, } #[cfg(test)] From 51e29432dee698b1506ba25f5433c7963aa3b040 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Thu, 21 Nov 2024 19:34:46 +0100 Subject: [PATCH 3/4] fix(eventsub): add dedicated `Swearing` variant to automod --- src/eventsub/automod/message/hold.rs | 5 +---- src/eventsub/automod/message/update.rs | 5 +---- src/eventsub/automod/mod.rs | 4 +++- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/eventsub/automod/message/hold.rs b/src/eventsub/automod/message/hold.rs index 7c79dc3050..3a0099571a 100644 --- a/src/eventsub/automod/message/hold.rs +++ b/src/eventsub/automod/message/hold.rs @@ -283,10 +283,7 @@ fn parse_payload_v2_automod() { let AutomodHeldReason::Automod { automod } = ¬if.reason else { panic!("invalid held reason"); }; - assert_eq!( - automod.category, - AutomodCategory::Unknown("swearing".to_string()) - ); + assert_eq!(automod.category, AutomodCategory::Swearing); assert_eq!(automod.level, 4); assert_eq!( automod.boundaries, diff --git a/src/eventsub/automod/message/update.rs b/src/eventsub/automod/message/update.rs index 7832e61871..d6d658abb6 100644 --- a/src/eventsub/automod/message/update.rs +++ b/src/eventsub/automod/message/update.rs @@ -324,10 +324,7 @@ fn parse_payload_v2_automod() { let AutomodHeldReason::Automod { automod } = ¬if.reason else { panic!("invalid held reason"); }; - assert_eq!( - automod.category, - AutomodCategory::Unknown("swearing".to_string()) - ); + assert_eq!(automod.category, AutomodCategory::Swearing); assert_eq!(automod.level, 4); assert_eq!( automod.boundaries, diff --git a/src/eventsub/automod/mod.rs b/src/eventsub/automod/mod.rs index af2febe141..70b31d84a4 100644 --- a/src/eventsub/automod/mod.rs +++ b/src/eventsub/automod/mod.rs @@ -43,8 +43,10 @@ pub enum AutomodCategory { Misogyny, /// Racist language or behavior. Racism, - /// Profane language or swearing. + /// Profane language. Profanity, + /// Use of swear words or expletives. + Swearing, /// An unknown category identified by Automod, contains the raw string provided by Twitch. #[serde(untagged)] Unknown(String), From 170411c2a7760616bb57cd89fcb301ed0ac6e8d7 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Fri, 22 Nov 2024 19:15:20 +0100 Subject: [PATCH 4/4] deps: update `twitch_types` to v0.4.8 --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/eventsub/channel/subscription/message.rs | 2 +- twitch_types | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b1daf1cb8d..c8cf104e43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3216,7 +3216,7 @@ dependencies = [ [[package]] name = "twitch_types" -version = "0.4.7" +version = "0.4.8" dependencies = [ "serde", "serde_derive", diff --git a/Cargo.toml b/Cargo.toml index ce178092e1..e0366d10a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ exclude = ["twitch_types", "twitch_oauth2"] [workspace.dependencies] twitch_api = { version = "0.7.0-rc.8", path = "." } twitch_oauth2 = { version = "0.14.0", path = "twitch_oauth2/" } -twitch_types = { version = "0.4.7", features = [ +twitch_types = { version = "0.4.8", features = [ "serde", ], path = "./twitch_types" } ureq = { version = "2.10.1", default-features = false, features = [ diff --git a/src/eventsub/channel/subscription/message.rs b/src/eventsub/channel/subscription/message.rs index a96d30b043..639a478571 100644 --- a/src/eventsub/channel/subscription/message.rs +++ b/src/eventsub/channel/subscription/message.rs @@ -71,7 +71,7 @@ pub struct SubscriptionMessage { pub text: String, /// An array that includes the emote ID and start and end positions for where the emote appears in the text. #[serde(deserialize_with = "crate::deserialize_default_from_null")] - pub emotes: Vec, + pub emotes: Vec, } #[cfg(test)] diff --git a/twitch_types b/twitch_types index 486c5f36bb..2c3a5e1f15 160000 --- a/twitch_types +++ b/twitch_types @@ -1 +1 @@ -Subproject commit 486c5f36bb08d95218935d858a5c9f32f09a44bd +Subproject commit 2c3a5e1f1550bde19d61ab2d760f6d2cb44650f3