@@ -25,18 +25,30 @@ impl EventSubscription for ChannelBanV1 {
25
25
#[ cfg_attr( not( feature = "allow_unknown_fields" ) , serde( deny_unknown_fields) ) ]
26
26
#[ non_exhaustive]
27
27
pub struct ChannelBanV1Payload {
28
- /// The requested broadcaster ID.
29
- pub broadcaster_user_id : types:: UserId ,
30
- /// The requested broadcaster login.
31
- pub broadcaster_user_login : types:: UserName ,
32
- /// The requested broadcaster display name.
33
- pub broadcaster_user_name : types:: DisplayName ,
34
28
/// The user ID for the user who was banned on the specified channel.
35
29
pub user_id : types:: UserId ,
36
30
/// The user login for the user who was banned on the specified channel.
37
31
pub user_login : types:: UserName ,
38
32
/// The requested broadcaster display name.
39
33
pub user_name : types:: DisplayName ,
34
+ /// The requested broadcaster ID.
35
+ pub broadcaster_user_id : types:: UserId ,
36
+ /// The requested broadcaster login.
37
+ pub broadcaster_user_login : types:: UserName ,
38
+ /// The requested broadcaster display name.
39
+ pub broadcaster_user_name : types:: DisplayName ,
40
+ /// The user ID of the issuer of the ban.
41
+ pub moderator_user_id : types:: UserId ,
42
+ /// The user login of the issuer of the ban.
43
+ pub moderator_user_login : types:: UserName ,
44
+ /// The user name of the issuer of the ban.
45
+ pub moderator_user_name : types:: DisplayName ,
46
+ /// The reason behind the ban.
47
+ pub reason : String ,
48
+ /// Will be null if permanent ban. If it is a timeout, this field shows when the timeout will end.
49
+ pub ends_at : Option < types:: Timestamp > ,
50
+ /// Indicates whether the ban is permanent (true) or a timeout (false). If true, ends_at will be null.
51
+ pub is_permanent : bool ,
40
52
}
41
53
42
54
#[ test]
@@ -62,7 +74,13 @@ fn parse_payload() {
62
74
"user_name": "Cool_User",
63
75
"broadcaster_user_id": "1337",
64
76
"broadcaster_user_login": "cooler_user",
65
- "broadcaster_user_name": "Cooler_User"
77
+ "broadcaster_user_name": "Cooler_User",
78
+ "moderator_user_id": "1339",
79
+ "moderator_user_login": "mod_user",
80
+ "moderator_user_name": "Mod_User",
81
+ "reason": "Offensive language",
82
+ "ends_at": "2020-07-15T18:16:11.17106713Z",
83
+ "is_permanent": false
66
84
}
67
85
}
68
86
"# ;
0 commit comments